add<KNFK>("KNFK");
add<KNSFKR>("KNSFKR");
add<KSFK>("KSFK");
+ add<KSFKF>("KSFKF");
add<KNPK>("KNPK");
add<KNPKB>("KNPKB");
}
Value result = Value(PushClose[distance(winnerKSq, loserKSq)])
- + PushToCorners[map_to_standard_board(pos, loserKSq)] / 10;
+ + (PushToCorners[map_to_standard_board(pos, loserKSq)] - 3000) / 10;
return strongSide == pos.side_to_move() ? result : -result;
}
}
+/// Mate with KSF vs KF.
+template<>
+Value Endgame<KSFKF>::operator()(const Position& pos) const {
+
+ assert(verify_material(pos, strongSide, SilverValueMg + FersValueMg, 0));
+ assert(verify_material(pos, weakSide, FersValueMg, 0));
+
+ Square winnerKSq = pos.square<KING>(strongSide);
+ Square loserKSq = pos.square<KING>(weakSide);
+ Square fersSq = pos.square<FERS>(weakSide);
+
+ Value result = SilverValueEg
+ + PushClose[distance(winnerKSq, loserKSq)]
+ + PushAway[distance(fersSq, loserKSq)]
+ + PushToOpposingSideEdges[map_to_standard_board(pos, relative_square(strongSide, loserKSq, pos.max_rank()))];
+
+ return strongSide == pos.side_to_move() ? result : -result;
+}
+
+
/// KB and one or more pawns vs K. It checks for draws with rook pawns and
/// a bishop of the wrong color. If such a draw is detected, SCALE_FACTOR_DRAW
/// is returned. If not, the return value is SCALE_FACTOR_NONE, i.e. no scaling