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 Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sun, Nov 5, 2023 05:42 PM UTC in reply to Fergus Duniho from 03:55 PM:

I decided to look into why this is a problem. It's that foreach, which is used to go through the values of a -Range function in the stalemated subroutine, exits when it gets a false value. This is because the PHP next function, which the next command uses to get the next value in an array, returns false if the array has no more elements. So, I have a conditional checking whether this value is false, and if it is false, it decrements the scope, which breaks out of the loop. To allow array elements with false values, I need another way to tell whether there are any more elements in the array.