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

Difference between revisions of "Move Representation"


 
Line 1: Line 1:
The move is represented by a 32-bit integer
+
The move is represented by a 16-bit integer
 
value with following bit mask.
 
value with following bit mask.
00000000000000000000000000111111 - source
+
 
00000000000000000000111111000000 - destination
+
0000000000111111 - index of square from.<br>
00000000000000000011000000000000 - type
+
0000001111000000 - promotion piece (optionally).<br>
00000000000000111100000000000000 - castle
+
1111110000000000 - index of square to.<br>
00000000111111000000000000000000 - en passant
+
 
00001111000000000000000000000000 - capture
+
First six bits are used for the description of source square, next four for promotion piece type and last six for destination square. Promotion piece type is
11110000000000000000000000000000 - promotion
+
optionaly.
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.
 

Revision as of 07:22, 14 October 2006

The move is represented by a 16-bit integer value with following bit mask.

0000000000111111 - index of square from.
0000001111000000 - promotion piece (optionally).
1111110000000000 - index of square to.

First six bits are used for the description of source square, next four for promotion piece type and last six for destination square. Promotion piece type is optionaly.