Check out Glinski's Hexagonal Chess, our featured variant for May, 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

The birth of 3 new variants- part 3 : Grand Apothecary Chess Classic[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Sun, May 30, 2021 04:30 PM UTC in reply to Aurelian Florea from 08:31 AM:

@Fergus It seems that the infinite loop was caused by the following code:

setelem op .JW + elem .JW op 1; setelem op .jw + elem .jw op 1;

That's two lines of code. In the first line, you are trying to increment #op[".JW"] by one, and in the second, you are trying to increment #op[".jw"] by one.

.jw is the wazir camel piece and I had wanted to to increase the number of them in reserve. Probably the dot is causing trouble. Do you agree?

Yes, it looks like it is causing trouble. In a test I ran, it incremented #op["JW"] and #op["jw"] by one instead of the elements you named. This is probably because the period is now used as a separator between array and element names, and the setelem command now just concatenates the array and element names by putting a period between them, and uses this concatenated name with the function for setting a user variable.

What I would recommend is to follow the instructions I have previously given for replacing piece labels without using aliases, which is in the comments for the Game Courier Developer's Guide. This would give you nice clean piece labels that you can use in your code without running into problems like this.