MahjongRepository/mahjong

Missing duplicate pair check for Chiitoitsu

Mystouille opened this issue · 2 comments

Code for Chiitoitsu is:
def is_condition_met(self, hand, *args): return len(hand) == 7

But riichi rules specify that all pairs must be different.
I suggest something like:

def is_condition_met(self, hand, *args): return len(hand) == 7 and len(set(hand))==len(hand)

Thanks for the report!

Actually there we don't have a bug, the validation on identical pairs will be done before we are checking hand on chitoitsu yaku. I added the unit test to confirm it: 98efa91

Let me know if you still think that there is a bug.