From ff62cf2c73e1ba4524d5d67d15224f0ab093ba59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20C=C3=A1ceres?= Date: Sat, 6 Jan 2024 21:02:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=B7=F0=9F=8F=BD=E2=80=8D=E2=99=82?= =?UTF-8?q?=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Lynx/ZobristTable.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Lynx/ZobristTable.cs b/src/Lynx/ZobristTable.cs index ba648b853..d92b9418e 100644 --- a/src/Lynx/ZobristTable.cs +++ b/src/Lynx/ZobristTable.cs @@ -11,11 +11,6 @@ public static class ZobristTable { private static readonly long[,] _table = Initialize(); - private static readonly long WK_Hash = _table[(int)BoardSquare.a8, (int)Piece.p]; - private static readonly long WQ_Hash = _table[(int)BoardSquare.b8, (int)Piece.p]; - private static readonly long BK_Hash = _table[(int)BoardSquare.c8, (int)Piece.p]; - private static readonly long BQ_Hash = _table[(int)BoardSquare.d8, (int)Piece.p]; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long PieceHash(int boardSquare, int piece) => _table[boardSquare, piece]; @@ -64,6 +59,11 @@ public static long SideHash() [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long CastleHash(byte castle) { + var WK_Hash = _table[(int)BoardSquare.a8, (int)Piece.p]; + var WQ_Hash = _table[(int)BoardSquare.b8, (int)Piece.p]; + var BK_Hash = _table[(int)BoardSquare.c8, (int)Piece.p]; + var BQ_Hash = _table[(int)BoardSquare.d8, (int)Piece.p]; + return castle switch { 0 => 0, // - | -