Increase size of internal repetition table to avoid possible bounds error

This commit is contained in:
Sebastian Lague 2023-08-01 16:52:10 +02:00
parent f19b15dcab
commit bcd8cbb423

View file

@ -11,8 +11,9 @@ namespace ChessChallenge.Chess
public RepetitionTable()
{
hashes = new ulong[256];
startIndices = new int[hashes.Length + 1];
const int size = 1024;
hashes = new ulong[size - 1];
startIndices = new int[size];
}
public void Init(Board board)
@ -36,9 +37,9 @@ namespace ChessChallenge.Chess
{
hashes[count] = hash;
startIndices[count + 1] = reset ? count : startIndices[count];
}
count++;
}
}
public void TryPop()
{