- const Bitboard SpaceMask[2] = {
- (1ULL<<SQ_C2) | (1ULL<<SQ_D2) | (1ULL<<SQ_E2) | (1ULL<<SQ_F2) |
- (1ULL<<SQ_C3) | (1ULL<<SQ_D3) | (1ULL<<SQ_E3) | (1ULL<<SQ_F3) |
- (1ULL<<SQ_C4) | (1ULL<<SQ_D4) | (1ULL<<SQ_E4) | (1ULL<<SQ_F4),
- (1ULL<<SQ_C7) | (1ULL<<SQ_D7) | (1ULL<<SQ_E7) | (1ULL<<SQ_F7) |
- (1ULL<<SQ_C6) | (1ULL<<SQ_D6) | (1ULL<<SQ_E6) | (1ULL<<SQ_F6) |
- (1ULL<<SQ_C5) | (1ULL<<SQ_D5) | (1ULL<<SQ_E5) | (1ULL<<SQ_F5)
- };
-
- /// King safety constants and variables. The king safety scores are taken
- /// from the array SafetyTable[]. Various little "meta-bonuses" measuring
- /// the strength of the attack are added up into an integer, which is used
- /// as an index to SafetyTable[].
-
- // Attack weights for each piece type
- const int QueenAttackWeight = 5;
- const int RookAttackWeight = 3;
- const int BishopAttackWeight = 2;
- const int KnightAttackWeight = 2;
-
- // Bonuses for safe checks, initialized from UCI options
- int QueenContactCheckBonus, DiscoveredCheckBonus;
- int QueenCheckBonus, RookCheckBonus, BishopCheckBonus, KnightCheckBonus;
-
- // Scan for queen contact mates?
- const bool QueenContactMates = true;
-
- // Bonus for having a mate threat, initialized from UCI options
- int MateThreatBonus;
-
- // ThreatBonus[][] contains bonus according to which piece type
- // attacks which one.
- const Value MidgameThreatBonus[8][8] = {
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
- { V(0),V(30), V(0),V(50), V(70), V(70), V(0), V(0) }, // KNIGHT attacks
- { V(0),V(30),V(50), V(0), V(70), V(70), V(0), V(0) }, // BISHOP attacks
- { V(0),V(20),V(40),V(40), V(0), V(50), V(0), V(0) }, // ROOK attacks
- { V(0),V(40),V(40),V(40), V(40), V(0), V(0), V(0) }, // QUEEN attacks
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) } // not used
- };
-
- const Value EndgameThreatBonus[8][8] = {
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
- { V(0),V(40), V(0),V(50),V(100),V(100), V(0), V(0) }, // KNIGHT attacks
- { V(0),V(40),V(50), V(0),V(100),V(100), V(0), V(0) }, // BISHOP attacks
- { V(0),V(30),V(50),V(50), V(0), V(50), V(0), V(0) }, // ROOK attacks
- { V(0),V(40),V(40),V(40), V(40), V(0), V(0), V(0) }, // QUEEN attacks
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
- { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) } // not used
- };
-
- // ThreatedByPawnPenalty[] contains a penalty according to which piece
- // type is attacked by an enemy pawn.
- const Value MidgameThreatedByPawnPenalty[8] = {
- V(0), V(0), V(50), V(50), V(70), V(80), V(0), V(0)