X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fendgame.cpp;h=7e005a28277f8d85b639d82af2439e5f5b672670;hb=HEAD;hp=73a4463362a6e2fb4e63cc1c676cab66aa779ab0;hpb=5a7b45eac9dedbf7ebc61d9deb4dd934058d1ca1;p=stockfish
diff --git a/src/endgame.cpp b/src/endgame.cpp
deleted file mode 100644
index 73a44633..00000000
--- a/src/endgame.cpp
+++ /dev/null
@@ -1,807 +0,0 @@
-/*
- Stockfish, a UCI chess playing engine derived from Glaurung 2.1
- Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
- Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
- Copyright (C) 2015-2020 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
-
- Stockfish is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Stockfish is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-*/
-
-#include
-
-#include "bitboard.h"
-#include "endgame.h"
-#include "movegen.h"
-
-using std::string;
-
-namespace {
-
- // Table used to drive the king towards the edge of the board
- // in KX vs K and KQ vs KR endgames.
- constexpr int PushToEdges[SQUARE_NB] = {
- 100, 90, 80, 70, 70, 80, 90, 100,
- 90, 70, 60, 50, 50, 60, 70, 90,
- 80, 60, 40, 30, 30, 40, 60, 80,
- 70, 50, 30, 20, 20, 30, 50, 70,
- 70, 50, 30, 20, 20, 30, 50, 70,
- 80, 60, 40, 30, 30, 40, 60, 80,
- 90, 70, 60, 50, 50, 60, 70, 90,
- 100, 90, 80, 70, 70, 80, 90, 100
- };
-
- // Table used to drive the king towards a corner square of the
- // right color in KBN vs K endgames.
- constexpr int PushToCorners[SQUARE_NB] = {
- 6400, 6080, 5760, 5440, 5120, 4800, 4480, 4160,
- 6080, 5760, 5440, 5120, 4800, 4480, 4160, 4480,
- 5760, 5440, 4960, 4480, 4480, 4000, 4480, 4800,
- 5440, 5120, 4480, 3840, 3520, 4480, 4800, 5120,
- 5120, 4800, 4480, 3520, 3840, 4480, 5120, 5440,
- 4800, 4480, 4000, 4480, 4480, 4960, 5440, 5760,
- 4480, 4160, 4480, 4800, 5120, 5440, 5760, 6080,
- 4160, 4480, 4800, 5120, 5440, 5760, 6080, 6400
- };
-
- // Drive a piece close to or away from another piece
- inline int push_close(Square s1, Square s2) { return 140 - 20 * distance(s1, s2); }
- inline int push_away(Square s1, Square s2) { return 120 - push_close(s1, s2); }
-
- // Pawn Rank based scaling factors used in KRPPKRP endgame
- constexpr 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(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(strongSide) == 1);
-
- if (file_of(pos.square(strongSide)) >= FILE_E)
- sq = flip_file(sq);
-
- return strongSide == WHITE ? sq : flip_rank(sq);
- }
-
-} // namespace
-
-
-namespace Endgames {
-
- std::pair