- // The attacking side is given a descending bonus based on distance between
- // the two kings in basic endgames.
- const int DistanceBonus[8] = { 0, 0, 100, 80, 60, 40, 20, 10 };
+ // Tables used to drive a piece towards or away from another piece
+ const int PushClose[8] = { 0, 0, 100, 80, 60, 40, 20, 10 };
+ const int PushAway [8] = { 0, 5, 20, 40, 60, 80, 90, 100 };
+
+ // Pawn Rank based scaling factors used in KRPPKRP endgame
+ const int KRPPKRPScaleFactors[RANK_NB] = { 0, 9, 10, 14, 21, 44, 0, 0 };
+
+#ifndef NDEBUG
+ bool verify_material(const Position& pos, Color c, Value npm, int pawnsCnt) {
+ return pos.non_pawn_material(c) == npm && pos.count<PAWN>(c) == pawnsCnt;
+ }
+#endif
+
+ // Map the square as if strongSide is white and strongSide's only pawn
+ // is on the left half of the board.
+ Square normalize(const Position& pos, Color strongSide, Square sq) {
+
+ assert(pos.count<PAWN>(strongSide) == 1);