Check out Grant Acedrex, our featured variant for April, 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

How to Enforce Rules in Game Courier. A tutorial on programming a rule-enforcing preset in the GAME Code language.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Mon, Mar 13, 2023 12:29 PM UTC in reply to H. G. Muller from 09:31 AM:

(But in shuffle games you would also have to remember the start position, or at least the random seed used for generating it.)

It normally stores the seed, but when several games of Fischer Random Chess broke because PHP's algorithm for selecting random numbers had changed, I added constants to the language. Since Game Courier is designed for correspondence games, it runs a game from the beginning for each new move. Unlike variables, whose values are determined only by the running of the program and the input fed to it, constant values were stored in logs or $_POST data so that they would be available without re-running the code that originally generated them. The main thing distinguishing a constant is that it's value survives from one run of the program to the next. With that in mind, its value may be changed if necessary, but this is done with a special command, since going along with the way constants work in other languages, a constant is supposed to keep the same value.