- return strongerSide == pos.side_to_move() ? result : -result;
-}
-
-
-/// KBB vs KN. This is almost always a win. We try to push enemy king to a corner
-/// and away from his knight. For a reference of this difficult endgame see:
-/// en.wikipedia.org/wiki/Chess_endgame#Effect_of_tablebases_on_endgame_theory
-
-template<>
-Value Endgame<KBBKN>::operator()(const Position& pos) const {
-
- assert(pos.non_pawn_material(strongerSide) == 2 * BishopValueMg);
- assert(pos.non_pawn_material(weakerSide ) == KnightValueMg);
- assert(pos.count<BISHOP>(strongerSide) == 2);
- assert(pos.count<KNIGHT>(weakerSide ) == 1);
- assert(!pos.pieces(PAWN));
-
- Square winnerKSq = pos.king_square(strongerSide);
- Square loserKSq = pos.king_square(weakerSide);
- Square knightSq = pos.list<KNIGHT>(weakerSide)[0];
-
- Value result = VALUE_KNOWN_WIN
- + PushToCorners[loserKSq]
- + PushClose[square_distance(winnerKSq, loserKSq)]
- + PushAway[square_distance(loserKSq, knightSq)];
-
- return strongerSide == pos.side_to_move() ? result : -result;