+Relevant occupancy bit count lookup tables

This commit is contained in:
rektdie committed 2024-03-19 09:14:01 +01:00
1 parent 9680d905bd
commit 67f68c7598
2 files changed
+24 -2

No files matched your search

-2
View File
@@ -9,7 +9,5 @@ int main() {
Board board;
board.Init();
Bitboard::getOccupancy(4095, maskRookAttacks(e5)).PrintBoard();
return 0;
}
+24
View File
@@ -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];