critter-mj / akochan

Artificial Intelligence for Japanese mahjong

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

legal chi and dahai judge, may be bug

heartup opened this issue · comments

if (haikind(hai) < haikind(consumed0) && haikind(hai) < haikind(consumed1) && haikind(dahai) == haikind(hai) + 2) { return false; }

I think it should be the following:
if (haikind(hai) < haikind(consumed0) && haikind(hai) < haikind(consumed1) && haikind(dahai) == haikind(hai) + 3) { return false; }
if (haikind(hai) > haikind(consumed0) && haikind(hai) > haikind(consumed1) && haikind(dahai) == haikind(hai) - 3) { return false; }

Thank you for reporting!
I'm glad to know that the code is checked by other developers.
Now I have fixed this bug.