+Value Endgame<KRKN>::operator()(const Position& pos) const {
+
+ assert(verify_material(pos, strongSide, RookValueMg, 0));
+ assert(verify_material(pos, weakSide, KnightValueMg, 0));
+
+ Square bksq = pos.king_square(weakSide);
+ Square bnsq = pos.list<KNIGHT>(weakSide)[0];
+ Value result = Value(PushToEdges[bksq] + PushAway[square_distance(bksq, bnsq)]);
+ return strongSide == pos.side_to_move() ? result : -result;
+}
+
+
+/// KQ vs KP. In general, this is a win for the stronger side, but there are a
+/// few important exceptions. A pawn on 7th rank and on the A,C,F or H files
+/// with a king positioned next to it can be a draw, so in that case, we only
+/// use the distance between the kings.
+template<>
+Value Endgame<KQKP>::operator()(const Position& pos) const {
+
+ assert(verify_material(pos, strongSide, QueenValueMg, 0));
+ assert(verify_material(pos, weakSide, VALUE_ZERO, 1));