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

Expanded Chess. An attempt at a logical expansion of Chess to a 10x10 board.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Thu, Jul 2, 2020 12:50 PM UTC:

The underlined parts are arguments to where, which takes three arguments. The first argument, which you haven't underlined, is the starting coordinate. The next one is a number of files, and the last one is a number of ranks. These values may be negative or positive, and this determines direction. Using these values, where returns the coordinate that is so many files and ranks away in the given directions. This is being used to calculate the coordinate of the turning square, which is one of the arguments for each of the Lambda functions. This uses sign, which returns -1, 0, or 1, depending on whether a value is negative, zero, or positive. When 0 comes first, it will typically be calculating where #0 0 1 or where #0 0 -1. Where 0 is last, it will typically be calculating where #0 1 0 or where #0 -1 0. When the destination is on the same file or rank, and it is not a Wazir move away, it may sometimes return where #0 0 0, which will be the starting space. Since there is no Bishop move to a space on the same rank or file, the function will return false for such a destination, which is correct. For potential moves, it will return false even earlier, since that space will still be occupied.