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

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 Sat, Nov 11, 2017 04:47 PM UTC:

Noticing that the % operator was giving a division by zero error, I modified the % and mod operators in GAME Code to return the first argument when the second argument is zero. Here is my reasoning for this. x % y = x - floor(x / y) * y. Since anything times zero is zero, the value of floor(x / y) does not affect the product of floor(x / y) * y when y is zero. So, even if x/y is undefined, the final product of floor(x / y) * y should still be zero when y is zero. When this is subtracted from x, the result is x.