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 06:24 PM UTC in reply to Fergus Duniho from 05:42 PM:

Since each() is deprecated, I used key() to tell whether it had reached the end of the array. Although the documentation said it returned false upon reaching the end of the array, tests showed that it returned null. So, I just checked whether it was empty, which should be safe, as the key will have incremented beyond 0 after calling next(). So, now the foreach command will not terminate early when reaching a false value, and your original code should now work properly.