A Move is encoded as a bit field:
Bits | Description |
---|---|
0,1,2 | The destination file. |
3,4,5 | The destination rank. |
6,7,8 | The source file. |
9,10,11 | The source rank. |
12,13,14 | Promotion piece. |
NOTE: Bit 0 is the least significant bit.
A Promoted Piece is encoded as follows:
Promoted Piece | Value |
---|---|
None | 0 |
Knight | 1 |
Bishop | 2 |
Rook | 3 |
Queen | 4 |
Castling moves are represented unconventionally as follows:
Color | Castle Side | Polygot Move |
---|---|---|
White | King-side Castle | e1h1 |
White | Queen-side Castle | e1a1 |
Black | King-side Castle | e8h8 |
Black | Queen-side Castle | e8a8 |
NOTE: It is technically possible that these moves are legal non-castling moves.