rewrote IsThreefold | bench 1154407
This commit is contained in:
1 parent
6453ffa5bd
commit
09ab31974b
2 files changed
+7
-7
No files matched your search
+1
-1
@@ -344,8 +344,8 @@ void Board::MakeMove(Move move) {
|
|||||||
|
|
||||||
GenAttackMaps(*this);
|
GenAttackMaps(*this);
|
||||||
|
|
||||||
positionHistory[positionIndex] = hashKey;
|
|
||||||
positionIndex++;
|
positionIndex++;
|
||||||
|
positionHistory[positionIndex] = hashKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Board::InPossibleZug(bool side) {
|
bool Board::InPossibleZug(bool side) {
|
||||||
|
|||||||
+6
-6
@@ -84,14 +84,14 @@ void ListScores(Board &board, int ply) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool IsThreefold(Board &board) {
|
static bool IsThreefold(Board &board) {
|
||||||
int count = 0;
|
for (int i = 0; i < positionIndex; i++) {
|
||||||
|
if (positionHistory[i] == board.hashKey) {
|
||||||
for (int i = positionIndex - 1; i >= 0; i--) {
|
// repetition found
|
||||||
if (positionHistory[i] == board.hashKey) count++;
|
return true;
|
||||||
|
}
|
||||||
if (count >= 3) return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no repetition
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user