🕸Fergus Duniho wrote on Fri, Jun 23, 2017 08:24 PM UTC:
The bug discovered in a game of Capablanca Chess is now fixed. It was in castlepos, which was in the chess include file. It made a potential King move, verified that it was safe, and then restored the position. But verify [condition] is equivalent to "if [condition] is false, return false". So, if the King was not safe, and the Black King was not at g8 thanks to the White Chancellor on the exposed g file, it would exit the castlepos subroutine before it had restored the position, which resulted here in an erroneous move by the Black King to an unsafe position.
The bug discovered in a game of Capablanca Chess is now fixed. It was in castlepos, which was in the chess include file. It made a potential King move, verified that it was safe, and then restored the position. But verify [condition] is equivalent to "if [condition] is false, return false". So, if the King was not safe, and the Black King was not at g8 thanks to the White Chancellor on the exposed g file, it would exit the castlepos subroutine before it had restored the position, which resulted here in an erroneous move by the Black King to an unsafe position.