- // Doubled pawn penalty by file, middle game.
- const Value DoubledPawnMidgamePenalty[8] = {
- Value(20), Value(30), Value(34), Value(34),
- Value(34), Value(34), Value(30), Value(20)
- };
-
- // Doubled pawn penalty by file, endgame.
- const Value DoubledPawnEndgamePenalty[8] = {
- Value(35), Value(40), Value(40), Value(40),
- Value(40), Value(40), Value(40), Value(35)
- };
-
- // Isolated pawn penalty by file, middle game.
- const Value IsolatedPawnMidgamePenalty[8] = {
- Value(20), Value(30), Value(34), Value(34),
- Value(34), Value(34), Value(30), Value(20)
- };
-
- // Isolated pawn penalty by file, endgame.
- const Value IsolatedPawnEndgamePenalty[8] = {
- Value(35), Value(40), Value(40), Value(40),
- Value(40), Value(40), Value(40), Value(35)
- };
-
- // Backward pawn penalty by file, middle game.
- const Value BackwardPawnMidgamePenalty[8] = {
- Value(16), Value(24), Value(27), Value(27),
- Value(27), Value(27), Value(24), Value(16)
- };
-
- // Backward pawn penalty by file, endgame.
- const Value BackwardPawnEndgamePenalty[8] = {
- Value(28), Value(32), Value(32), Value(32),
- Value(32), Value(32), Value(32), Value(28)
- };
-
- // Pawn chain membership bonus by file, middle game.
- const Value ChainMidgameBonus[8] = {
- Value(14), Value(16), Value(17), Value(18),
- Value(18), Value(17), Value(16), Value(14)
- };
-
- // Pawn chain membership bonus by file, endgame.
- const Value ChainEndgameBonus[8] = {
- Value(16), Value(16), Value(16), Value(16),
- Value(16), Value(16), Value(16), Value(16)
- };
-
- // Candidate passed pawn bonus by rank, middle game.
- const Value CandidateMidgameBonus[8] = {
- Value(0), Value(12), Value(12), Value(20),
- Value(40), Value(90), Value(0), Value(0)
- };
-
- // Candidate passed pawn bonus by rank, endgame.
- const Value CandidateEndgameBonus[8] = {
- Value(0), Value(24), Value(24), Value(40),
- Value(80), Value(180), Value(0), Value(0)
- };
-
- // Evaluate pawn storms?
- const bool EvaluatePawnStorms = true;
-
- // Pawn storm tables for positions with opposite castling:
- const int QStormTable[64] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- -22, -22, -22, -13, -4, 0, 0, 0,
- -4, -9, -9, -9, -4, 0, 0, 0,
- 9, 18, 22, 18, 9, 0, 0, 0,
- 22, 31, 31, 22, 0, 0, 0, 0,
- 31, 40, 40, 31, 0, 0, 0, 0,
- 31, 40, 40, 31, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- const int KStormTable[64] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, -4, -13, -22, -27, -27,
- 0, 0, 0, -4, -9, -13, -18, -18,
- 0, 0, 0, 0, 9, 9, 9, 9,
- 0, 0, 0, 0, 9, 18, 27, 27,
- 0, 0, 0, 0, 9, 27, 40, 36,
- 0, 0, 0, 0, 0, 31, 40, 31,
- 0, 0, 0, 0, 0, 0, 0, 0
- };
-
- // Pawn storm open file bonuses by file:
- const int KStormOpenFileBonus[8] = {
- 45, 45, 30, 0, 0, 0, 0, 0
+ #define S(mg, eg) make_score(mg, eg)
+
+ // Doubled pawn penalty by opposed flag and file
+ const Score DoubledPawnPenalty[2][8] = {
+ { S(13, 43), S(20, 48), S(23, 48), S(23, 48),
+ S(23, 48), S(23, 48), S(20, 48), S(13, 43) },
+ { S(13, 43), S(20, 48), S(23, 48), S(23, 48),
+ S(23, 48), S(23, 48), S(20, 48), S(13, 43) }};
+
+ // Isolated pawn penalty by opposed flag and file
+ const Score IsolatedPawnPenalty[2][8] = {
+ { S(37, 45), S(54, 52), S(60, 52), S(60, 52),
+ S(60, 52), S(60, 52), S(54, 52), S(37, 45) },
+ { S(25, 30), S(36, 35), S(40, 35), S(40, 35),
+ S(40, 35), S(40, 35), S(36, 35), S(25, 30) }};
+
+ // Backward pawn penalty by opposed flag and file
+ const Score BackwardPawnPenalty[2][8] = {
+ { S(30, 42), S(43, 46), S(49, 46), S(49, 46),
+ S(49, 46), S(49, 46), S(43, 46), S(30, 42) },
+ { S(20, 28), S(29, 31), S(33, 31), S(33, 31),
+ S(33, 31), S(33, 31), S(29, 31), S(20, 28) }};
+
+ // Pawn chain membership bonus by file
+ const Score ChainBonus[8] = {
+ S(11,-1), S(13,-1), S(13,-1), S(14,-1),
+ S(14,-1), S(13,-1), S(13,-1), S(11,-1)