- /// 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 and table indexed on piece type
- const int QueenAttackWeight = 5;
- const int RookAttackWeight = 3;
- const int BishopAttackWeight = 2;
- const int KnightAttackWeight = 2;
-
- const int AttackWeight[] = { 0, 0, KnightAttackWeight, BishopAttackWeight, RookAttackWeight, QueenAttackWeight };
-
- // 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.
- #define Z make_score(0, 0)
-
- const Score ThreatBonus[8][8] = {
- { Z, Z, Z, Z, Z, Z, Z, Z }, // not used
- { Z, S(18,37), Z, S(37,47), S(55,97), S(55,97), Z, Z }, // KNIGHT attacks
- { Z, S(18,37), S(37,47), Z, S(55,97), S(55,97), Z, Z }, // BISHOP attacks
- { Z, S( 9,27), S(27,47), S(27,47), Z, S(37,47), Z, Z }, // ROOK attacks
- { Z, S(27,37), S(27,37), S(27,37), S(27,37), Z, Z, Z }, // QUEEN attacks
- { Z, Z, Z, Z, Z, Z, Z, Z }, // not used
- { Z, Z, Z, Z, Z, Z, Z, Z }, // not used
- { Z, Z, Z, Z, Z, Z, Z, Z } // not used
- };