Check out Atomic Chess, our featured variant for November, 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

Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sat, Dec 11, 2004 04:42 AM UTC:
I've debugged the code in the include file for Chess, and I've also made
it more generalized. I've included a castle subroutine that can make
castling much easier to implement, and I've generated arrays of which
pieces a Pawn may promote to out of the array of piece keys, which is
generated from the FEN code. I am now using this new version of the Chess
enforcement code for the Alfaerie JPG Chess preset as well as for the
Abstract Table preset.

http://play.chessvariants.org/pbm/includes/chess.txt

With the improvements I've recently made to GAME Code, it may now have
the computing power to spot checkmate, but it will still take someone to
figure out how to do it. I have a general of how to go about it. First,
check if the King is in check. If it is, then loop through the King's
possible moves, checking if any are legal. If none are legal, identify the
checking pieces. If there is more than one checking piece, it is checkmate.
Otherwise, check if any piece can legally capture the checking piece. If it
can't be captured, check if any piece can legally move to block the check.