Difference between revisions of "Position Representation"
Line 17: | Line 17: | ||
Bitboard is the best presentation of a chess position. The presentation contains a set of 64-bit integer numbers. Both sides have six numbers for all different types of pieces. For example, the position below has the following white pawns | Bitboard is the best presentation of a chess position. The presentation contains a set of 64-bit integer numbers. Both sides have six numbers for all different types of pieces. For example, the position below has the following white pawns | ||
presentation: | presentation: | ||
+ | |||
+ | {{Chess diagram|= | ||
+ | | tright | ||
+ | | '''W. Langstaff''', ''Chess Amateur'' 1922 | ||
+ | |= | ||
+ | |||
+ | 8 | | | | |kd| | |rd|= | ||
+ | 7 | | | | | | | | |= | ||
+ | 6 | | | | | |bl| |pl|= | ||
+ | 5 | | | |rl| |kl|pd|pl|= | ||
+ | 4 | | | | | | | | |= | ||
+ | 3 | | | | | | | | |= | ||
+ | 2 | | | | | | | | |= | ||
+ | 1 | | | | | | | | |= | ||
+ | a b c d e f g h | ||
+ | |||
+ | | '''Mate in two.''' <br> This problem uses ''partial retrograde analysis'' method. | ||
+ | }} |
Revision as of 12:41, 3 October 2006
The representation of a chess game includes representation of positions. Positions represent states of game and moves represent operators which are used to achieve transition from one position to another. Both of these representations must be able to do the following operations:
- make move
- unmake move
- generate a list of all possible moves
- generate a list of all possible capture moves
- evaluate a position
- store moves
- compare positions
- set position
- check if position has been repeated 3 times
- check role of 50 moves
- check if king is in check
All of these operations must be very time efficient because they take place inside the search algorithm. Efficient presentation of game will therefore exhibit an efficient chess program.
Bitboard is the best presentation of a chess position. The presentation contains a set of 64-bit integer numbers. Both sides have six numbers for all different types of pieces. For example, the position below has the following white pawns presentation: