Check out Makruk (Thai Chess), our featured variant for March, 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 Tue, Jul 21, 2020 02:46 AM UTC in reply to H. G. Muller from Mon Jul 20 09:12 AM:

The problem with using $prev is that it doesn't seem to offer any hope of expanding the capabilities to more than 1 move + 1 explicit side effect, something I would still like to do in the future.

I'm thinking of providing more information, but it requires an array, and I'm still looking into how I might handle that.

the store and restore this requires to not mess up the game state must also be an order of magnitude more expensive than just testing pseudo-legality of a given move.

It's not that expensive. It is just copying variables. But it is not needed. There is a checkbox in the Edit menu called "Do Not Include Moves in Code". Check this if you want to handle moves on your own without having them performed automatically. I just did this for Extra Move Chess, and I got rid of the store and restore lines.

Is there a variable that holds the current game length? ... is this a matter of comparing movenum with mln ?

It is a matter of comparing mln with $maxmln. When they are equal, it is the latest move.