X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fendgame.cpp;h=74e16fa6941b0e5e6196c4b319cbd122d6fa5940;hb=2e1369d0302a87d570e509af7041a1be22b836a0;hp=6745ee2664c612689646c283f78833355d509dcf;hpb=be5a2f015e45886e32867b4559ef51dd694a3cec;p=stockfish diff --git a/src/endgame.cpp b/src/endgame.cpp index 6745ee26..74e16fa6 100644 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@ -310,16 +310,17 @@ Value Endgame::operator()(const Position& pos) const { } -/// KNN vs KP. Simply push the opposing king to the corner +/// KNN vs KP. Very drawish, but there are some mate opportunities if we can +// press the weakSide King to a corner before the pawn advances too much. template<> Value Endgame::operator()(const Position& pos) const { assert(verify_material(pos, strongSide, 2 * KnightValueMg, 0)); assert(verify_material(pos, weakSide, VALUE_ZERO, 1)); - Value result = 2 * KnightValueEg - - PawnValueEg - + PushToEdges[pos.square(weakSide)]; + Value result = PawnValueEg + + 2 * PushToEdges[pos.square(weakSide)] + - 10 * relative_rank(weakSide, pos.square(weakSide)); return strongSide == pos.side_to_move() ? result : -result; }