-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Damn subtle bug #32
Comments
The code
is not the bug itself, but it is capable to do magic of "restoring" castle status. There was bishop at a8 moving to g2 that was erroneously detected as rook. The rook is also can restore castle status if rook moves twice from a8. The first move from a8 will reset castle flag, then if rook returns back to a8 and leave it again - we should check it, I am not sure but it can be also very surprising I also wonder why castling[turn] is assigned twice, = and ^= are both assignments |
Good find. Looking back on some of this old castling code is a little embarrassing. I've got a fix that I'll post shortly along with a regression test or two. Thanks for the report. |
Great, this bug was very tough to find |
The black king obtained the queenside castle! Magic! Losing castle status may happen, but restoring castle status is something very new in the chess!
The text was updated successfully, but these errors were encountered: