MahjongRepository / mahjong

Implementation of riichi mahjong related stuff (hand cost, shanten, agari end, etc.)
MIT License
377 stars 38 forks source link

Problem of daburu chuuren poutou #13

Closed ting830812 closed 5 years ago

ting830812 commented 5 years ago

Hi, I have tried the following code:

calculator = HandCalculator()

tiles = TilesConverter.string_to_136_array(man='11123456789999')
win_tile = TilesConverter.string_to_136_array(man='9')[0]

result = calculator.estimate_hand_value(tiles, win_tile)

print(result.han, result.fu)
print(result.cost['main'])
print(result.yaku)
for fu_item in result.fu_details:
    print(fu_item)

and it output:

13 40
32000
[Chuuren Poutou]
{'fu': 30, 'reason': 'base'}
{'fu': 4, 'reason': 'open_terminal_pon'}

However, based on the rule, it should be Daburu Chuuren Poutou. Same problem happened when tiles = 11112345678999.

If I ron or tsumo with 2-8, it will output Daburu Chuuren Poutou normally. Did I misunderstand any rule or forget to set any parameter?

Thanks!

Nihisil commented 5 years ago

Your configuration looks correct. There is a bug with daburu chuuren poutou and winning 1, 9 tiles. I added this ticket to the tasks list. Thank you for the report!

Nihisil commented 5 years ago

Fixed with v1.1.8 https://github.com/MahjongRepository/mahjong/releases/tag/v1.1.8