I'm dealing with tiles with red dora and these might be useful debugging. In tile.py.
Sincerely Illava
@staticmethod
def to_one_line_string(tiles, has_aka_dora=False):
"""
Convert 136 tiles array to the one line string
Example of output 123s123p123m33z
"""
tiles = sorted(tiles)
man = [t for t in tiles if t < 36]
pin = [t for t in tiles if 36 <= t < 72]
pin = [t - 36 for t in pin]
sou = [t for t in tiles if 72 <= t < 108]
sou = [t - 72 for t in sou]
honors = [t for t in tiles if t >= 108]
honors = [t - 108 for t in honors]
def words(suits, red_five, suffix):
return suits and ''.join(["0" if i == red_five and has_aka_dora else str((i // 4) + 1) for i in suits]) + suffix or ''
sou = words(sou, FIVE_RED_SOU - 72, 's')
pin = words(pin, FIVE_RED_PIN - 36, 'p')
man = words(man, FIVE_RED_MAN, 'm')
honors = words(honors, -1 - 108, 'z')
return man + pin + sou + honors
I'm dealing with tiles with red dora and these might be useful debugging. In
tile.py
. Sincerely Illava