fixed checkmate and stalemate detection
This commit is contained in:
1 parent
3090dbac8b
commit
d4c7263b93
5 files changed
+24
-27
No files matched your search
+2
-2
@@ -12,7 +12,7 @@ static U64 HelperPerft(Board board, int depth) {
|
||||
for (int i = 0; i < board.currentMoveIndex; i++) {
|
||||
if (!board.IsLegal(board.moveList[i])) continue;
|
||||
Board copy = board;
|
||||
copy.MakeMove(board.moveList[i]);
|
||||
copy.MakeMove(board.moveList[i], false);
|
||||
nodes += HelperPerft(copy, depth - 1);
|
||||
positionIndex--;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ void Perft(Board &board, int depth) {
|
||||
for (int i = 0; i < board.currentMoveIndex; i++) {
|
||||
if (!board.IsLegal(board.moveList[i])) continue;
|
||||
Board copy = board;
|
||||
copy.MakeMove(board.moveList[i]);
|
||||
copy.MakeMove(board.moveList[i], false);
|
||||
U64 nodeCount = HelperPerft(copy, depth - 1);
|
||||
positionIndex--;
|
||||
totalNodes += nodeCount;
|
||||
|
||||
Reference in new issue
Block a user