Exemple #1
0
def get(tehai,
        reach=False,
        kyoku=1,
        honba=0,
        arg_bakaze=31,
        arg_jikaze=31,
        tsumo=False,
        arg_agari_hai=0,
        dora=[0] * 8,
        ippatsu=False,
        arg_furo=[],
        kan=[],
        double_reach=False,
        chankan=False,
        haitei=False,
        houtei=False,
        tenho=False,
        chiho=False):

    if len(tehai) <= 14:
        tehai_hist = mj_util.get_hist(tehai)
    else:
        tehai_hist = tehai[:]
    #print tehai_hist
    #自風から親を判定
    if jikaze == 31:
        oya = True
    else:
        oya = False
    #fan,fu = get_fan_fu(tehai_hist)
    fan, fu = get_fan_fu(tehai_hist,
                         reach=reach,
                         kyoku=kyoku,
                         honba=honba,
                         arg_bakaze=arg_bakaze,
                         arg_jikaze=arg_jikaze,
                         tsumo=tsumo,
                         arg_agari_hai=arg_agari_hai,
                         dora=dora,
                         ippatsu=ippatsu,
                         arg_furo=arg_furo,
                         kan=kan,
                         double_reach=double_reach,
                         chankan=chankan,
                         haitei=haitei,
                         houtei=houtei,
                         tenho=tenho,
                         chiho=chiho)

    #️if fan > 0:
    #    print str(fan) + "翻"
    #    print tehai_hist

    tokuten = get_tokuten(fan, fu, oya=oya)

    return tokuten
Exemple #2
0
            8: 16000,
            9: 16000,
            10: 16000,
            11: 24000,
            12: 24000,
            13: 32000
        }
        if tokuten_dic.has_key(fan):
            tokuten = tokuten_dic[fan]
        else:
            tokuten = 0
        if oya_flg:
            tokuten = tokuten * 1.5
        return tokuten


if __name__ == "__main__":
    #tehai = [1,1,9,9,11,11,19,19,21,21,31,31,32,32]
    tehai = [2, 3, 4, 12, 12, 12, 12, 13, 14, 22, 22, 22, 28, 28]
    tehai_hist = mj_util.get_hist(tehai)
    print(tehai_hist)
    mj_tehai = MJTehai()
    print(mj_tehai.get_tokuten(tehai_hist, reach_flg=True))
    """
    start_time = time.time()
    for _ in range(200000):
        get_syanten(tehai_hist)
    elapsed_time = time.time() - start_time
    print("elapsed_time:{0}".format(elapsed_time))
    """