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 ]

Comments/Ratings for a Single Item

EarliestEarlier Reverse Order Later
The birth of 3 new variants- part 3 : Grand Apothecary Chess Classic[Subject Thread] [Add Response]
Aurelian Florea wrote on Sat, May 29, 2021 04:03 AM EDT:

@Fergus

https://www.chessvariants.com/play/pbm/play.php?game=Grand+Apothecary+Chess+3&settings=Default

In the link above I have a preset for one of my new games. Once after saving the  preset I could not acces it anymore as I get a totally white window. I use microsoft edge. What happens?


🕸Fergus Duniho wrote on Sat, May 29, 2021 01:48 PM EDT in reply to Aurelian Florea from 04:03 AM:

I have a preset for one of my new games. Once after saving the preset I could not access it anymore as I get a totally white window. I use microsoft edge. What happens?

My best guess is that your code contains an infinite loop. You can figure things out more precisely by going here:

https://www.chessvariants.com/play/pbm/play.php?game=Grand+Apothecary+Chess+3&settings=Default&submit=Edit

  1. Save each block of code to a text file on your computer.
  2. Delete each full block of code in turn until you determine which block of code is causing this to happen.
  3. Restore your code from your backup.
  4. Working with the block of code that is buggy, delete or comment out large portions of it to determine where the problem lies. Make sure that each portion you delete or comment out can be safely removed without breaking up control structures.
  5. Once you isolate the problem to a large section, delete or comment out smaller parts of that section until you find the line that is causing your problem.
  6. Examine that line to figure out what the problem is, fix it, and see if it fixes your problem.

Aurelian Florea wrote on Sun, May 30, 2021 04:31 AM EDT in reply to Fergus Duniho from Sat May 29 01:48 PM:

@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;

.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?


🕸Fergus Duniho wrote on Sun, May 30, 2021 12:30 PM EDT in reply to Aurelian Florea from 04: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.


Aurelian Florea wrote on Mon, May 31, 2021 02:20 AM EDT in reply to Fergus Duniho from Sun May 30 12:30 PM:

The comments section of the developer guide does not work on edge!


Aurelian Florea wrote on Mon, May 31, 2021 03:01 AM EDT in reply to Fergus Duniho from Sun May 30 12:30 PM:

Works now. Don't worry.


6 comments displayed

EarliestEarlier Reverse Order Later

Permalink to the exact comments currently displayed.