- /// Constants and variables
-
- // Doubled pawn penalty by file, middle game
- const Value DoubledPawnMidgamePenalty[8] = {
- Value(13), Value(20), Value(23), Value(23),
- Value(23), Value(23), Value(20), Value(13)
- };
-
- // Doubled pawn penalty by file, endgame
- const Value DoubledPawnEndgamePenalty[8] = {
- Value(43), Value(48), Value(48), Value(48),
- Value(48), Value(48), Value(48), Value(43)
- };
-
- // Isolated pawn penalty by file, middle game
- const Value IsolatedPawnMidgamePenalty[8] = {
- Value(25), Value(36), Value(40), Value(40),
- Value(40), Value(40), Value(36), Value(25)
- };
-
- // Isolated pawn penalty by file, endgame
- const Value IsolatedPawnEndgamePenalty[8] = {
- Value(30), Value(35), Value(35), Value(35),
- Value(35), Value(35), Value(35), Value(30)
- };
-
- // Backward pawn penalty by file, middle game
- const Value BackwardPawnMidgamePenalty[8] = {
- Value(20), Value(29), Value(33), Value(33),
- Value(33), Value(33), Value(29), Value(20)
- };
-
- // Backward pawn penalty by file, endgame
- const Value BackwardPawnEndgamePenalty[8] = {
- Value(28), Value(31), Value(31), Value(31),
- Value(31), Value(31), Value(31), Value(28)
- };
-
- // Pawn chain membership bonus by file, middle game
- const Value ChainMidgameBonus[8] = {
- Value(11), Value(13), Value(13), Value(14),
- Value(14), Value(13), Value(13), Value(11)
- };
-
- // Pawn chain membership bonus by file, endgame
- const Value ChainEndgameBonus[8] = {
- Value(-1), Value(-1), Value(-1), Value(-1),
- Value(-1), Value(-1), Value(-1), Value(-1)
- };
-
- // Candidate passed pawn bonus by rank, middle game
- const Value CandidateMidgameBonus[8] = {
- Value( 0), Value( 6), Value(6), Value(14),
- Value(34), Value(83), Value(0), Value( 0)
+ #define V Value
+ #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)