mahjong icon indicating copy to clipboard operation
mahjong copied to clipboard

Wrong Shanten Calculating

Open taeho-gwon opened this issue 3 years ago • 1 comments

sh = Shanten()
tiles = TilesConverter.string_to_34_array(man='123456789', honors='1111')
print(sh.calculate_shanten_for_regular_hand(tiles))
tiles2 = TilesConverter.string_to_34_array(man='123456789', pin='1111')
print(sh.calculate_shanten_for_regular_hand(tiles2))

output

1
0

In shanten calculation, 4 non-honor tiles can be used as meld and waiting itself as pair, but it is impossible.

taeho-gwon avatar Aug 04 '22 07:08 taeho-gwon

Thanks for the report, the shanten calculations are more correct with 14 tiles.

With 13 tiles, it may have the issue as you mentioned.

The bug needed to be fixed.

Nihisil avatar Aug 28 '22 07:08 Nihisil