Skip to content

Instantly share code, notes, and snippets.

@ilamanov
Created March 15, 2022 11:01
Show Gist options
  • Select an option

  • Save ilamanov/b3029b4f545445d1387370eb4c44002b to your computer and use it in GitHub Desktop.

Select an option

Save ilamanov/b3029b4f545445d1387370eb4c44002b to your computer and use it in GitHub Desktop.
Move representation
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