- // Isolated pawn penalty by opposed flag
- const Score Isolated[] = { S(27, 30), S(13, 18) };
-
- // Backward pawn penalty by opposed flag
- const Score Backward[] = { S(40, 26), S(24, 12) };
-
- // Connected pawn bonus by opposed, phalanx, #support and rank
- Score Connected[2][2][3][RANK_NB];
-
- // Doubled pawn penalty
- const Score Doubled = S(18, 38);
-
- // Lever bonus by rank
- const Score Lever[RANK_NB] = {
- S( 0, 0), S( 0, 0), S(0, 0), S(0, 0),
- S(17, 16), S(33, 32), S(0, 0), S(0, 0)
- };
-
- // Weakness of our pawn shelter in front of the king by [isKingFile][distance from edge][rank].
- // RANK_1 = 0 is used for files where we have no pawns or our pawn is behind our king.
- const Value ShelterWeakness[][int(FILE_NB) / 2][RANK_NB] = {
- { { V( 97), V(17), V( 9), V(44), V( 84), V( 87), V( 99) }, // Not On King file
- { V(106), V( 6), V(33), V(86), V( 87), V(104), V(112) },
- { V(101), V( 2), V(65), V(98), V( 58), V( 89), V(115) },
- { V( 73), V( 7), V(54), V(73), V( 84), V( 83), V(111) } },
- { { V(104), V(20), V( 6), V(27), V( 86), V( 93), V( 82) }, // On King file
- { V(123), V( 9), V(34), V(96), V(112), V( 88), V( 75) },
- { V(120), V(25), V(65), V(91), V( 66), V( 78), V(117) },
- { V( 81), V( 2), V(47), V(63), V( 94), V( 93), V(104) } }
+ // Pawn penalties
+ constexpr Score Backward = S( 9, 24);
+ constexpr Score BlockedStorm = S(82, 82);
+ constexpr Score Doubled = S(11, 56);
+ constexpr Score Isolated = S( 5, 15);
+ constexpr Score WeakLever = S( 0, 56);
+ constexpr Score WeakUnopposed = S(13, 27);
+
+ // Connected pawn bonus
+ constexpr int Connected[RANK_NB] = { 0, 7, 8, 12, 29, 48, 86 };
+
+ // Strength of pawn shelter for our king by [distance from edge][rank].
+ // RANK_1 = 0 is used for files where we have no pawn, or pawn is behind our king.
+ constexpr Value ShelterStrength[int(FILE_NB) / 2][RANK_NB] = {
+ { V( -6), V( 81), V( 93), V( 58), V( 39), V( 18), V( 25) },
+ { V(-43), V( 61), V( 35), V(-49), V(-29), V(-11), V( -63) },
+ { V(-10), V( 75), V( 23), V( -2), V( 32), V( 3), V( -45) },
+ { V(-39), V(-13), V(-29), V(-52), V(-48), V(-67), V(-166) }