Check out Grant Acedrex, our featured variant for April, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

The Fairychess Include File Tutorial. How to use the fairychess include file to program games for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Thu, Apr 2, 2020 10:02 PM UTC:

You have a bunch of lines beginning with or and and. Each of these lines is checking for islower space #1 or for isupper space #1, and that's where your problem lies. In potential moves, space #1 will contain what is on the space prior to making the move, which won't be the King, but for actual moves, it will contain the piece that has moved there. I gather you mean to be making sure that only the King whose first move is contained in the variable on that line gets to move. This works for actual moves, but it is not working for potential moves, because in potential moves, space #1 contains the value of the piece on the space prior to making the move.

In Chess, the King is allowed to castle on the first move, and keeping track of whether the King has already moved is handled by flagging the space the King begins on, then unsetting the flag with every subsequent King move. This easily works for both Kings, because each King begins on a different space. So, I recommend flagging the King's initial spaces rather than keeping separate K1stmove and k1stmove variables.