Example #1
0
def test_sanankou_ron(test_input, agari_tile, expected):
    result = False
    for division in divide_hand(AgariHand(test_input, agari_tile),
                                is_tsumo_agari=False):
        result |= Sanankou().is_satisfied(division,
                                          HandInfo(is_tsumo_agari=False))
    assert result == expected
Example #2
0
def calc_point():

    print('점수 계산입니다.')
    while True:
        hand_str = input('손패 코드를 입력해주세요 ( 종료 : q ): ')
        if hand_str == 'q':
            break

        agari_tile_str = input('화료 패 코드를 입력하세요: ')
        agari_tile = 0
        for item in Tile.STRING.items():
            if item[1] == agari_tile_str:
                agari_tile = item[0]
                break

        hand = AgariHand(hand_str, agari_tile)
        hand_info = HandInfo()
        print(calculate_hand_point(hand, hand_info))
Example #3
0
def test_sanshoku(test_input, agari_tile, expected):
    result = False
    for division in divide_hand(AgariHand(test_input, agari_tile)):
        result |= Sanshoku().is_satisfied(division, HandInfo())
    assert result == expected