RyanStonebraker/Snowball

Invalid Corner Case

Closed this issue · 1 comments

When the boardstate 11001010110121000211122221222222 is used, the AI generates and uses the illegal boardstate 11001010110121002211022021222222, wrapping around the board.
screen shot 2018-02-01 at 12 56 24 pm
screen shot 2018-02-01 at 12 58 01 pm
screen shot 2018-02-01 at 12 58 07 pm

There was a precedence issue in moveGenerator.cpp -> checkKill -> bool rightKillCondition & bool backRightKillCondition:

Originally I had:

position + 1 % 8 != 0

which evaluates the (1%8) before doing (position+1)

It has now been changed to

(position + 1) % 8 != 0

which resolves the error.