From 67f68c7598f703793c5b91cb330fe5cbb0f42f5c Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 19 Mar 2024 09:14:01 +0100 Subject: [PATCH] +Relevant occupancy bit count lookup tables --- source/main.cpp | 2 -- source/movegen.h | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index 220fb6b..0247e3c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -9,7 +9,5 @@ int main() { Board board; board.Init(); - Bitboard::getOccupancy(4095, maskRookAttacks(e5)).PrintBoard(); - return 0; } \ No newline at end of file diff --git a/source/movegen.h b/source/movegen.h index 9d10e02..843f3c0 100644 --- a/source/movegen.h +++ b/source/movegen.h @@ -1,6 +1,30 @@ #pragma once #include "bitboards.h" +// bishop relevant occupancy bit count +constexpr int bishopRelevantBits[64] = { + 6, 5, 5, 5, 5, 5, 5, 6, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 7, 7, 7, 7, 5, 5, + 5, 5, 7, 9, 9, 7, 5, 5, + 5, 5, 7, 9, 9, 7, 5, 5, + 5, 5, 7, 7, 7, 7, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 6, 5, 5, 5, 5, 5, 5, 6 +}; + +// rook relevant occupancy bit count +constexpr int rookRelevantBits[64] = { + 12, 11, 11, 11, 11, 11, 11, 12, + 11, 10, 10, 10, 10, 10, 10, 11, + 11, 10, 10, 10, 10, 10, 10, 11, + 11, 10, 10, 10, 10, 10, 10, 11, + 11, 10, 10, 10, 10, 10, 10, 11, + 11, 10, 10, 10, 10, 10, 10, 11, + 11, 10, 10, 10, 10, 10, 10, 11, + 12, 11, 11, 11, 11, 11, 11, 12 +}; + // pawn attacks table [side][square] extern Bitboard pawnAttacks[2][64]; extern Bitboard knightAttacks[64];