Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Move Representation


Revision as of 07:16, 14 October 2006 by Borko (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The move is represented by a 32-bit integer value with following bit mask. 00000000000000000000000000111111 - source 00000000000000000000111111000000 - destination 00000000000000000011000000000000 - type 00000000000000111100000000000000 - castle 00000000111111000000000000000000 - en passant 00001111000000000000000000000000 - capture 11110000000000000000000000000000 - promotion First six bits are used for the description of source square, next six for destination square. Next two bits represent the type of move which can be: normal (+ capture), en passant, castle, and promotion (+ capture). The next four bits are used for castle. The next six bits are used to save the original en passant square. The next 4 bits are used for saving the capture piece and last 4 bits for promotion piece. Information within first 14 bits is used very frequently in chess programs. To achieve the desired speedup we added the rest of the information which speeds up functionality in unmaking moves.