Closed muchojp closed 2 years ago
If I want to specify man and pin include Aka Dora and sou isn't included Aka Dora, are there any options?
You can try this one:
tiles = TilesConverter.string_to_136_array(man='234550', pin='550', sou='22555', has_aka_dora=True)
Where is 0
is aka dora. Also for aka doras you can use special constants (they are equal to tenhou.net aka dora tile codes): https://github.com/MahjongRepository/mahjong/blob/959d22b222bacfd773a4df10fc79120fe889a17f/mahjong/constants.py#L16
Wow, It works! Thanks for replying and for the solution.
For visitors of this question, I'll make a note. I change the above script from
win_tile = TilesConverter.string_to_136_array(sou='5')[0]
into
win_tile = TilesConverter.string_to_136_array(sou='5', has_aka_dora=True)[0]
The reason: In the No Aka rule: man 5 -> 16-19 In the Aka rule: man red 5 -> 16, normal man 5 -> 17-19 The index is different a little bit between the rules.
Therefore, in the above case, we need to specify the win_tile is normal sou 5 (the index is different from Aka sou 5). If you forget has_aka_dora=True, the result will return None because the program considers win_tile is not included in tiles.
Thank you for developing the mahjong package.
I have one question. Are there detailed options for Aka Dora? Using the example script, I tried the below script
The result is
With this config, three types (man, pin, and sou) of 5 are regarded as Aka. Thus, the result returns Aka Dora 3. If I want to specify man and pin include Aka Dora and sou isn't included Aka Dora, are there any options?
Best regards.