Each potential move is stored in a 32 bit integer
The move integer is a member of a structure. Members of the structure are :
- move – a 32 bit integer representing the move.
- score – an integer used for MVV/LVA move ordering.
- quiet – a bool that indicates whether the move is a quiet move.
Byte from | Byte To | Represents | How to query |
1 | 7 | Square From | move & 0x7F |
8 | 14 | Square To | ((move >>7) & 0x7F) |
15 | 18 | Castling | ((move >> 14) & 0x0F) |
19 | 22 | Captured Piece | ((move >> 18) & 0xF) |
23 | 26 | Promoted Piece | ((move >> 22) & 0xF) |
27 | 27 | En Passant Flag | (1u & (move >> 26)) |
See also:
Leave a Reply