- // to kingAdjacentZoneAttacksCount[WHITE].
- int kingAdjacentZoneAttacksCount[COLOR_NB];
- };
-
- #define V(v) Value(v)
- #define S(mg, eg) make_score(mg, eg)
-
- // MobilityBonus[PieceType-2][attacked] contains bonuses for middle and end game,
- // indexed by piece type and number of attacked squares in the mobility area.
- const Score MobilityBonus[][32] = {
- { S(-75,-76), S(-57,-54), S( -9,-28), S( -2,-10), S( 6, 5), S( 14, 12), // Knights
- S( 22, 26), S( 29, 29), S( 36, 29) },
- { S(-48,-59), S(-20,-23), S( 16, -3), S( 26, 13), S( 38, 24), S( 51, 42), // Bishops
- S( 55, 54), S( 63, 57), S( 63, 65), S( 68, 73), S( 81, 78), S( 81, 86),
- S( 91, 88), S( 98, 97) },
- { S(-58,-76), S(-27,-18), S(-15, 28), S(-10, 55), S( -5, 69), S( -2, 82), // Rooks
- S( 9,112), S( 16,118), S( 30,132), S( 29,142), S( 32,155), S( 38,165),
- S( 46,166), S( 48,169), S( 58,171) },
- { S(-39,-36), S(-21,-15), S( 3, 8), S( 3, 18), S( 14, 34), S( 22, 54), // Queens
- S( 28, 61), S( 41, 73), S( 43, 79), S( 48, 92), S( 56, 94), S( 60,104),
- S( 60,113), S( 66,120), S( 67,123), S( 70,126), S( 71,133), S( 73,136),
- S( 79,140), S( 88,143), S( 88,148), S( 99,166), S(102,170), S(102,175),
- S(106,184), S(109,191), S(113,206), S(116,212) }
- };
-
- // Outpost[knight/bishop][supported by pawn] contains bonuses for minor
- // pieces if they can reach an outpost square, bigger if that square is
- // supported by a pawn. If the minor piece occupies an outpost square
- // then score is doubled.
- const Score Outpost[][2] = {
- { S(22, 6), S(36,12) }, // Knight
- { S( 9, 2), S(15, 5) } // Bishop
- };
-
- // RookOnFile[semiopen/open] contains bonuses for each rook when there is no
- // friendly pawn on the rook file.
- const Score RookOnFile[] = { S(20, 7), S(45, 20) };
-
- // ThreatByMinor/ByRook[attacked PieceType] contains bonuses according to
- // which piece type attacks which one. Attacks on lesser pieces which are
- // pawn-defended are not considered.
- const Score ThreatByMinor[PIECE_TYPE_NB] = {
- S(0, 0), S(0, 31), S(39, 42), S(57, 44), S(68, 112), S(47, 120)
- };
-
- const Score ThreatByRook[PIECE_TYPE_NB] = {
- S(0, 0), S(0, 24), S(38, 71), S(38, 61), S(0, 38), S(36, 38)
- };
-
- // ThreatByKing[on one/on many] contains bonuses for king attacks on
- // pawns or pieces which are not pawn-defended.
- const Score ThreatByKing[] = { S(3, 65), S(9, 145) };
-
- // Passed[mg/eg][Rank] contains midgame and endgame bonuses for passed pawns.
- // We don't use a Score because we process the two components independently.
- const Value Passed[][RANK_NB] = {
- { V(0), V(5), V( 5), V(32), V(70), V(172), V(217) },
- { V(0), V(7), V(13), V(42), V(70), V(170), V(269) }