Ejemplo n.º 1
0
def cal_weihe(ball):
    '''
    计算尾和
    :param 输入Foliagessq或者Tssqshishibiao的对象:
    :return:红球尾和,不包含蓝球
    '''
    ssq_red=ball.list_red_balls()
    ssq_property=TSsqShishibiao_ext()
    ssq_property.red_weihe=0
    for i in ssq_red:
        # print int(i)%10
        if i >10:
            ssq_property.red_weihe+=int(i)%10
    return ssq_property.red_weihe
Ejemplo n.º 2
0
def cal_shishibiao_ext(tss_ball):
    #事实表根据本次球算出扩展属性,返回shishibiao_ext类型对象
    ball_ext=TSsqShishibiao_ext()
    ball_ext.id=tss_ball.num
    ball_ext.num=tss_ball.num
    ball_ext.red_sum=tss_ball.sum1
    ball_ext.prime_reds=cal_zhishu(tss_ball)#质数
    ball_ext.odd_reds=cal_odd_reds(tss_ball)#偶数
    ball_ext.red_shouweikuadu=cal_all_kuadu(tss_ball)#红球首尾快读
    ball_ext.red_weihe=cal_weihe(tss_ball)#首尾跨度
    ball_ext.red_lianhaoshu=cal_lianhao(tss_ball)#连号数
    ball_ext.vertical_blue=cal_blue_differ(tss_ball)#蓝球跨度
    ball_ext.span_reds(cal_horizontal_span(tss_ball))#红球横向差
    ball_ext.vertical_reds(cal_vertical_red(tss_ball))#红球纵向差

    return ball_ext