Check out Modern Chess, our featured variant for January, 2025.


[ 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

Play-test applet for chess variants. Applet you can play your own variant against.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Fri, Jul 17, 2020 11:36 AM UTC in reply to H. G. Muller from 11:36 AM:

What would be the best place to read up on GAME code? There seems to be a lot of material about it here, but it seems that GAME code evolved a lot, and not everything is up to date.

The most recent thing is the tutorial on the Fairychess Include file. The Developer's Guide is also important.

One thing that is not clear to me after glancing through one of the tutorials is how these code snippets are embedded in the larger design of the server. I would have expected checking a given move for pseudo-legality to be a different task from performing a move for updating the position, but I did not recognize that in the examples.

It is different. See the distinction between potential and actual moves.

E.g. the routine for Pawn moves seems to automatically clear the e.p. square. Which seems a problem if the move later turns out to be illegal (e.g. because the victim on the e.p. square was sheltering your King). Is there an automatic takeback when you say 'die' at any stage?

The die command exits the program with a message, behaving just the same as the PHP function. When this happens, the player should use the back arrow and reload the script to make a different move. Instead of continuously running a script during the entire course of a game, Game Courier runs the same script numerous times. When a player is ready to move, he runs the script to see the current position. When he makes his move, the scipt runs again to show the preview. When he confirms his move, the script runs for a third time. If he makes an illegal move, this is caught during the preview, at which time the log has not yet been updated with a new move. All he has to do is go back, run the script again to see the current position, and make a different move.