From 869af6662b28f8c772e3cbc87d0d88326e0ed662 Mon Sep 17 00:00:00 2001 From: rektdie Date: Sat, 29 Jun 2024 05:38:15 +0200 Subject: [PATCH] switched to 3d array for storing zobrist piece keys --- source/tt.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/tt.cpp b/source/tt.cpp index 1d87a13..489cc1b 100644 --- a/source/tt.cpp +++ b/source/tt.cpp @@ -1,10 +1,11 @@ #include "tt.h" #include "types.h" +#include static inline U64 initialSeed = 0x60919C48E57863B9; // 2[colors] * 6[pieces] * 64[squares] -static U64 zKeys[768]; +static U64 zKeys[2][6][64]; // There are 8 files static U64 zEnPassant[8]; @@ -24,9 +25,9 @@ void InitZobrist() { for (int i = White; i <= Black; i++) { for (int j = Pawn; j <= King; j++) { for (int k = a1; k <= h8; k++) { - zKeys[i+j+k] = RandomNum(); + zKeys[i][j][k] = RandomNum(); } - } + } } // init en passant file keys