Created
March 15, 2022 10:59
-
-
Save ilamanov/c134e16e2ec767fa6d24ba4093906e6f to your computer and use it in GitHub Desktop.
Sentinels and whose turn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contract Chess { | |
| /// The top/bottom rows and left/right columns are treated as sentinel rows/columns for efficient | |
| /// boundary validation (see {Chess-generateMoves} and {Chess-isValid}). i.e., (63, ..., 56), | |
| /// (07, ..., 00), (63, ..., 07), and (56, ..., 00) never contain pieces. Every bit in those rows | |
| /// and columns should be ignored, except for the last bit. The last bit denotes whose turn it is to | |
| /// play (0 means black's turn; 1 means white's turn). e.g. a potential starting position: | |
| /// Black | |
| /// 00 00 00 00 00 00 00 00 Black | |
| /// 00 03 02 05 06 02 03 00 ♜ ♝ ♛ ♚ ♝ ♜ | |
| /// 00 01 01 01 01 01 01 00 ♟ ♟ ♟ ♟ ♟ ♟ | |
| /// 00 00 00 00 00 00 00 00 denotes | |
| /// 00 00 00 00 00 00 00 00 the board | |
| /// 00 09 09 09 09 09 09 00 ♙ ♙ ♙ ♙ ♙ ♙ | |
| /// 00 11 12 13 14 12 11 00 ♖ ♘ ♕ ♔ ♘ ♖ | |
| /// 00 00 00 00 00 00 00 01 White | |
| /// White | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment