Threefold #22

Merged
rektdie merged 5 commits from threefold into main 2025-03-18 14:25:52 +01:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit 09ab31974b - Show all commits

No files matched your search

+1 -1
View File
@@ -344,8 +344,8 @@ void Board::MakeMove(Move move) {
GenAttackMaps(*this);
positionHistory[positionIndex] = hashKey;
positionIndex++;
positionHistory[positionIndex] = hashKey;
}
bool Board::InPossibleZug(bool side) {
+6 -6
View File
@@ -84,14 +84,14 @@ void ListScores(Board &board, int ply) {
}
static bool IsThreefold(Board &board) {
int count = 0;
for (int i = positionIndex - 1; i >= 0; i--) {
if (positionHistory[i] == board.hashKey) count++;
if (count >= 3) return true;
for (int i = 0; i < positionIndex; i++) {
if (positionHistory[i] == board.hashKey) {
// repetition found
return true;
}
}
// no repetition
return false;
}