Paul Webster’s Games & Blogs

Move Representation

·

·

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 fromByte ToRepresentsHow to query
17Square Frommove & 0x7F
814Square To((move >>7) & 0x7F)
1518Castling((move >> 14) & 0x0F)
1922Captured Piece((move >> 18) & 0xF)
2326Promoted Piece((move >> 22) & 0xF)
2727En Passant Flag(1u & (move >> 26))

See also:

Piece Representation

Castling Representation


One response to “Move Representation”
  1. […] hold a field, score, on the Move Representation, to hold the MVV/LVA score, populated when we add moves . 1 million is added to score to allow room […]

Leave a Reply

Your email address will not be published. Required fields are marked *