- #define V(v) Value(v)
- #define S(mg, eg) make_score(mg, eg)
-
- // MobilityBonus[PieceType][attacked] contains bonuses for middle and end
- // game, indexed by piece type and number of attacked squares not occupied by
- // friendly pieces.
- const Score MobilityBonus[][32] = {
- {}, {},
- { S(-68,-49), S(-46,-33), S(-3,-12), S( 5, -4), S( 9, 11), S(15, 16), // Knights
- S( 23, 27), S( 33, 28), S(37, 29) },
- { S(-49,-44), S(-23,-16), S(16, 1), S(29, 16), S(40, 25), S(51, 34), // Bishops
- S( 55, 43), S( 61, 49), S(64, 51), S(68, 52), S(73, 55), S(75, 60),
- S( 80, 65), S( 86, 66) },
- { S(-50,-57), S(-28,-22), S(-11, 7), S(-1, 29), S( 0, 39), S( 1, 46), // Rooks
- S( 10, 66), S( 16, 79), S(22, 86), S(23,103), S(30,109), S(33,111),
- S( 37,115), S( 38,119), S(48,124) },
- { S(-43,-30), S(-27,-15), S( 1, -5), S( 2, -3), S(14, 10), S(18, 24), // Queens
- S( 20, 27), S( 33, 37), S(33, 38), S(34, 43), S(40, 46), S(43, 56),
- S( 46, 61), S( 52, 63), S(52, 63), S(57, 65), S(60, 70), S(61, 74),
- S( 67, 80), S( 76, 82), S(77, 88), S(82, 94), S(86, 95), S(90, 96),
- S( 94, 99), S( 96,100), S(99,111), S(99,112) }
+#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.
+ constexpr Score MobilityBonus[][32] = {
+ { S(-62,-79), S(-53,-57), S(-12,-31), S( -3,-17), S( 3, 7), S( 12, 13), // Knight
+ S( 21, 16), S( 28, 21), S( 37, 26) },
+ { S(-47,-59), S(-20,-25), S( 14, -8), S( 29, 12), S( 39, 21), S( 53, 40), // Bishop
+ S( 53, 56), S( 60, 58), S( 62, 65), S( 69, 72), S( 78, 78), S( 83, 87),
+ S( 91, 88), S( 96, 98) },
+ { S(-60,-82), S(-24,-15), S( 0, 17) ,S( 3, 43), S( 4, 72), S( 14,100), // Rook
+ S( 20,102), S( 30,122), S( 41,133), S(41 ,139), S( 41,153), S( 45,160),
+ S( 57,165), S( 58,170), S( 67,175) },
+ { S(-29,-49), S(-16,-29), S( -8, -8), S( -8, 17), S( 18, 39), S( 25, 54), // Queen
+ S( 23, 59), S( 37, 73), S( 41, 76), S( 54, 95), S( 65, 95) ,S( 68,101),
+ S( 69,124), S( 70,128), S( 70,132), S( 70,133) ,S( 71,136), S( 72,140),
+ S( 74,147), S( 76,149), S( 90,153), S(104,169), S(105,171), S(106,171),
+ S(112,178), S(114,185), S(114,187), S(119,221) }