- S(33, 31), S(33, 31), S(29, 31), S(20, 28) }};
-
- // Pawn chain membership bonus by file
- const Score ChainMember[FILE_NB][RANK_NB] = {
- { S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) },
- { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
- { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
- { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
- { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
- { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
- { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
- { S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) }
- };
-
- // Candidate passed pawn bonus by rank
- const Score CandidatePassed[RANK_NB] = {
- S( 0, 0), S( 6, 13), S(6,13), S(14,29),
- S(34,68), S(83,166), S(0, 0), S( 0, 0)
- };
-
- // Weakness of our pawn shelter in front of the king indexed by [rank]
- const Value ShelterWeakness[RANK_NB] =
- { V(100), V(0), V(27), V(73), V(92), V(101), V(101) };
-
- // Danger of enemy pawns moving toward our king indexed by
- // [no friendly pawn | pawn unblocked | pawn blocked][rank of enemy pawn]
- const Value StormDanger[3][RANK_NB] = {
- { V( 0), V(64), V(128), V(51), V(26) },
- { V(26), V(32), V( 96), V(38), V(20) },
- { V( 0), V( 0), V( 64), V(25), V(13) }};
+ S(33, 31), S(33, 31), S(29, 31), S(20, 28) } };
+
+ // Connected pawn bonus by opposed, phalanx flags and rank
+ Score Connected[2][2][RANK_NB];
+
+ // Levers bonus by rank
+ const Score Lever[RANK_NB] = {
+ S( 0, 0), S( 0, 0), S(0, 0), S(0, 0),
+ S(20,20), S(40,40), S(0, 0), S(0, 0) };
+
+ // Unsupported pawn penalty
+ const Score UnsupportedPawnPenalty = S(20, 10);
+
+ // Weakness of our pawn shelter in front of the king by [distance from edge][rank]
+ const Value ShelterWeakness[][RANK_NB] = {
+ { V( 99), V(23), V(24), V(54), V(85), V( 93), V(107) },
+ { V(119), V( 2), V(28), V(72), V(96), V(104), V(114) },
+ { V(103), V( 6), V(47), V(74), V(84), V(103), V( 94) },
+ { V( 78), V(10), V(41), V(64), V(88), V( 92), V(115) } };
+
+ // Danger of enemy pawns moving toward our king by [type][distance from edge][rank]
+ const Value StormDanger[][4][RANK_NB] = {
+ { { V( 0), V( 65), V( 125), V(37), V(30) },
+ { V( 0), V( 57), V( 136), V(39), V(24) },
+ { V( 0), V( 50), V( 114), V(45), V(29) },
+ { V( 0), V( 58), V( 129), V(56), V(34) } },
+ { { V(20), V( 45), V( 91), V(47), V(20) },
+ { V(25), V( 23), V( 105), V(38), V(14) },
+ { V(21), V( 37), V( 99), V(35), V(21) },
+ { V(30), V( 18), V( 105), V(38), V(28) } },
+ { { V( 0), V( 0), V( 81), V(13), V( 4) },
+ { V( 0), V( 0), V( 169), V(30), V( 4) },
+ { V( 0), V( 0), V( 166), V(24), V( 6) },
+ { V( 0), V( 0), V( 164), V(24), V(11) } },
+ { { V( 0), V(-289), V(-297), V(57), V(29) },
+ { V( 0), V( 66), V( 136), V(43), V(16) },
+ { V( 0), V( 66), V( 141), V(50), V(31) },
+ { V( 0), V( 63), V( 126), V(52), V(23) } } };