rewrote IsThreefold | bench 1154407

This commit is contained in:
rektdie committed 2025-03-18 12:34:21 +01:00
1 parent 6453ffa5bd
commit 09ab31974b
2 files changed
+7 -7

No files matched your search

+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;
}