def is_yakuhai(groups, prevailing_wind, player_wind): """ TODO: need to count multiple yakuhai """ plets = get_plets(groups) valid_honours = ((WindTile(prevailing_wind), WindTile(player_wind)) + HONOURS[4:]) return sum([plet.tiles[0] in valid_honours for plet in get_plets(groups)]) >= 1
def is_sanshoku_doukou(groups): plets = get_plets(groups) if len(plets) < 3: return False numbers = [plet.tiles[0].number for plet in plets] return any([numbers.count(number) == 3 for number in NUMBERS])
def is_sanankou(groups): plets = get_plets(groups) if len(plets) < 3: return False return sum([plet.closed for plet in plets]) == 3
def is_toitoi(groups): return len(get_plets(groups)) == 4
def is_pinfu(groups, winning_tile): if get_plets(groups): return False return # TODO: get wait type