Fix butterfly history array size
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 22 Apr 2020 07:03:44 +0000 (09:03 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 22 Apr 2020 07:03:44 +0000 (09:03 +0200)
Closes #110.

src/movepick.h

index 334a62d..b4b71fd 100644 (file)
@@ -86,7 +86,7 @@ enum StatsType { NoCaptures, Captures };
 /// unsuccessful during the current search, and is used for reduction and move
 /// ordering decisions. It uses 2 tables (one for each color) indexed by
 /// the move's from and to squares, see www.chessprogramming.org/Butterfly_Boards
-typedef Stats<int16_t, 10692, COLOR_NB, int(SQUARE_NB + 1) * int(SQUARE_NB)> ButterflyHistory;
+typedef Stats<int16_t, 10692, COLOR_NB, int(SQUARE_NB + 1) * int(1 << SQUARE_BITS)> ButterflyHistory;
 
 /// CounterMoveHistory stores counter moves indexed by [piece][to] of the previous
 /// move, see www.chessprogramming.org/Countermove_Heuristic