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

Game Courier. PHP script for playing Chess variants online.[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Tue, May 21, 2024 12:20 PM UTC in reply to Aurelian Florea from 07:42 AM:

I don't think "if turn < 2:" , using < as infix operator is valid GAME code; I would expect something like "if < turn 2:"

I don't think you can do this in the Pre-Game code; I expect turn always to be 0 there, no matter how long the game is already progressing. Every time you submit or request the preset page GC would first execute the Pre-Game section, then the Pre-Move and Post-move sections for every stored move to set up the current position (increasing 'turn' in the process), and finally the Post-Game section. Preparation for the move to come (such as highlighting) should be done in the Post-Game section (where 'turn' will reflect the number of moves played so far).