Maintains a move history to handle the fifty-move rule and the threefold repetition rule.
For the first rules, we just maintains one move count per series of move which doesn't eat a piece or move a pawn.
For the second rules, we use two strategies, a fast but unreliable one and a second slower but exact.
A. Use two 16KB table of counter address by table[Zobrist key of the board mod 16KB]. Collision can occurs so its
only a good indication that the board can be there more than 2 times.
B. Keep a compressed representation of the board in an array to be able to count the number of identical boards.
View code on GitHub
Inheritance Hierarchy
Chess MoveHistory
Namespace: Chess
Assembly: Chess (in Chess.exe) Version: 1.1.1.0 (1.1.1)
Syntax
The MoveHistory type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MoveHistory |
Class constructor
View code on GitHub |
Methods
Name | Description | |
---|---|---|
AddCurrentPackedBoard |
Add the current packed board to the history
View code on GitHub | |
Clone |
Creates a clone of the MoveHistory
View code on GitHub | |
ComputePackedBoard |
Compute the packed representation of a board
View code on GitHub | |
GetCurrentBoardCount |
Get the current packed board count
View code on GitHub | |
LoadFromStream |
Load from stream
View code on GitHub | |
RemoveLastMove |
Remove the last move from the history
View code on GitHub | |
Reset |
Reset the move history
View code on GitHub | |
SaveToStream |
Save to stream
View code on GitHub | |
UnpackBoard |
Unpack a packed board to a board
View code on GitHub | |
UpdateCurrentPackedBoard(ChessBoard BoardStateMaskE) |
Update the current board packing
View code on GitHub | |
UpdateCurrentPackedBoard(Int32, ChessBoard PieceE) |
Update the current board packing
View code on GitHub |
See Also