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 Sat, May 25, 2024 08:53 AM UTC in reply to Fergus Duniho from Fri May 24 04:22 PM:

In fact, calling it more than once could result in the wrong value for $movenum. So, it makes sense to reserve its use for the Post-Move code.

I suppose you meant to write Post-Game code here?

If a Post-Move code would only use continuemove when it detects the current move is incomplete, it would automatically be called at most once, as all earlier moves in the game should be complete for the game to progress to the current one. Also note that the PTA-automated code is running with the "do not add moves" checkbox ticked, so that Post-Move initially is in fact Pre-Move, and only starts to do post-move processing when the code actually orders the move to be done. From the code you show it seems important to do continuemove after the last move was made (if this was incomplete).

I think the main danger of using continuemove at the termination of Post-Move is that it would not automatically suppress or alter what happens in Post-Game. While it is conceivable you want to use different highlighting for the second part of the move than you would have at the start of a turn, and you would not want the legality test, things that the Post-Game code would normally do.

So the best solution for Aurelian is probably to parse the move (in the prelude) in Post-Move, always perform the first move, then test if the second move was present, also make it if it was, but set variable ok to 2 when it wasn't. The Post-Game code for the prelude could then test the value of ok, and abort after invoking continuemove if it had value 2, possibly after recalculating the highlighting.