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

Difference between revisions of "Move Representation"


 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
The move is represented by a 32-bit integer
+
Moves have to be pithy and compact because in search algorithm we need to make moves and also store moves to use them later. A good schema for move representaton can be by a 16-bit integer value with following bit mask.
value with following bit mask.
+
 
00000000000000000000000000111111 - source
+
0000000000111111 - index of square from<br>
00000000000000000000111111000000 - destination
+
0000001111000000 - promotion piece (optionally)<br>
00000000000000000011000000000000 - type
+
1111110000000000 - index of square to<br>
00000000000000111100000000000000 - castle
+
 
00000000111111000000000000000000 - en passant
+
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.
00001111000000000000000000000000 - capture
+
 
11110000000000000000000000000000 - promotion
+
[[Category:Borko Bošković]]
First six bits are used for the description of
+
[[Category:Research activity]]
source square, next six for destination square.
+
[[Category:Chess program BBChess]]
Next two bits represent the type of move which
+
[[Category:Representation of Chess Game]]
can be: normal (+ capture), en passant, castle,
+
 
and promotion (+ capture). The next four bits are
+
[[sl:Bitna predstavitev potez]]
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.
 

Latest revision as of 09:05, 19 October 2006

Moves have to be pithy and compact because in search algorithm we need to make moves and also store moves to use them later. A good schema for move representaton can be 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.