Created
March 15, 2022 11:01
-
-
Save ilamanov/b3029b4f545445d1387370eb4c44002b to your computer and use it in GitHub Desktop.
Move representation
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 { | |
| /// ======================================Move Representation======================================= | |
| /// Each move is allocated 12 bits. The first 6 bits are the index the piece is moving from, and the | |
| /// last 6 bits are the index the piece is moving to. Since the index representing a square is at | |
| /// most 54, 6 bits sufficiently represents any index (0b111111 = 63 > 54). e.g. 1243 denotes a move | |
| /// from index 19 to 27 (1243 = (19 << 6) | 27). | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment