Exemple #1
0
def is_tanyao(groups):
    """
    Returns True if the hand satisfies tanyao.
    """
    tiles = flatten_groups(groups)
    return all([isinstance(tile, NumberedTile) and tile.number in range(2, 9)
                for tile in tiles])
Exemple #2
0
def is_chinitsu(groups):
    tiles = flatten_groups(groups)
    return any([all([isinstance(tile, numbered_tile) for tile in tiles]) for numbered_tile in NUMBERED_TILE_TYPES])