9#define RAND_64 ( (U64)std::rand() | \
10 (U64)std::rand() << 15 | \
11 (U64)std::rand() << 30 | \
12 (U64)std::rand() << 45 | \
13 ((U64)std::rand() & 0xF) << 60 )
42 for (
int i = 0; i < 8; ++i) {
50 const int sq = r * 8 + f;
57 for (
int sq = 0; sq < 64; ++sq) {
63 for (
int sq = 0; sq < 64; ++sq) {
65 for (
int tsq = sq + 8; tsq < 64; tsq += 8) {
68 for (
int tsq = sq - 8; tsq >= 0; tsq -= 8) {
77 for (
int tsq = sq + 7; tsq < 64; tsq += 8) {
80 for (
int tsq = sq - 9; tsq >= 0; tsq -= 8) {
88 for (
int tsq = sq + 9; tsq < 64; tsq += 8) {
91 for (
int tsq = sq - 7; tsq >= 0; tsq -= 8) {
108 const int sq =
FR2SQ(f, r);
116 for (
int p = 0; p < 13; ++p) {
117 for (
int sq = 0; sq < 120; ++sq) {
123 for (
int i = 0; i < 16; ++i) {
129 for (
int i = 0; i < 64; ++i) {
133 for (
int i = 0; i < 64; ++i) {
147 const int sq120 =
FR2SQ(f, r);
void InitMvvLva()
Initialize the MVV-LVA capture scoring table.
void InitFilesrankIndex120()
Initialize file and rank lookup arrays.
U64 zobristSideKey
Zobrist hashing key for side to move.
void initEvaluationMasks()
Initialize evaluation-related bitboard masks.
int square120To64[BRD_SQ_NUM]
Lookup table to convert 120-based board index to 64-based.
int rankIndex120[BRD_SQ_NUM]
S_OPTIONS engineOptions[1]
Engine options structure.
void initBitMasks()
Initialize bit masks for individual bitboard operations.
int square64To120[64]
Lookup table to convert 64-based board index to 120-based.
U64 fileBitMask[8]
Bitboard masks for each file and rank.
void initZobristKeys()
Initialize Zobrist hash keys.
U64 setBitMask[64]
Bit masks for setting and clearing individual bits on a bitboard.
U64 blackPassedPawnMask[64]
Bitboard masks for pawn structure evaluation.
U64 zobristCastleKeys[16]
Zobrist hashing keys for castling rights.
void initializeEngine()
Run all initialization routines.
int fileIndex120[BRD_SQ_NUM]
File and rank lookup tables for each square (120-based).
void initSquareIndexMaps()
Initialize lookup tables for 120->64 square indexing.
U64 zobristPieceKeys[13][120]
Zobrist hashing keys for each piece on each square.
U64 whitePassedPawnMask[64]
int SqOnBoard(const int sq)
Checks if a given square index refers to a valid on-board square.