- // Connected pawn bonus by file and rank (initialized by formula)
- Score Connected[FILE_NB][RANK_NB];
-
- // 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) };
-
- // Bonus for file distance of the two outermost pawns
- const Score PawnsFileSpan = S(0, 15);
-
- // 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) } };
+ // 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(100), V(13), V(24), V(64), V(89), V( 93), V(104) },
+ { V(110), V( 1), V(29), V(75), V(96), V(102), V(107) },
+ { V(102), V( 0), V(39), V(74), V(88), V(101), V( 98) },
+ { V( 88), V( 4), V(33), V(67), V(92), V( 94), V(107) } };
+
+ // Danger of enemy pawns moving toward our king by [type][distance from edge][rank]
+ const Value StormDanger[][4][RANK_NB] = {
+ { { V( 0), V( 63), V( 128), V(43), V(27) },
+ { V( 0), V( 62), V( 131), V(44), V(26) },
+ { V( 0), V( 59), V( 121), V(50), V(28) },
+ { V( 0), V( 62), V( 127), V(54), V(28) } },
+ { { V(24), V( 40), V( 93), V(42), V(22) },
+ { V(24), V( 28), V( 101), V(38), V(20) },
+ { V(24), V( 32), V( 95), V(36), V(23) },
+ { V(27), V( 24), V( 99), V(36), V(24) } },
+ { { V( 0), V( 0), V( 81), V(16), V( 6) },
+ { V( 0), V( 0), V( 165), V(29), V( 9) },
+ { V( 0), V( 0), V( 163), V(23), V(12) },
+ { V( 0), V( 0), V( 161), V(28), V(13) } },
+ { { V( 0), V(-296), V(-299), V(55), V(25) },
+ { V( 0), V( 67), V( 131), V(46), V(21) },
+ { V( 0), V( 65), V( 135), V(50), V(31) },
+ { V( 0), V( 62), V( 128), V(51), V(24) } } };