return (strongerSide == pos.side_to_move() ? result : -result);
}
+
+/// K and two minors vs K and one or two minors or K and two knights against
+/// king alone are always draw.
template<>
Value EvaluationFunction<KmmKm>::apply(const Position&) {
return Value(0);
}
+template<>
+Value EvaluationFunction<KNNK>::apply(const Position&) {
+ return Value(0);
+}
/// KBPKScalingFunction scales endgames where the stronger side has king,
/// bishop and one or more pawns. It checks for draws with rook pawns and a
/// returned. If not, the return value is SCALE_FACTOR_NONE, i.e. no scaling
/// will be used.
template<>
-ScaleFactor ScalingFunction<KBPK>::apply(const Position& pos) {
+ScaleFactor ScalingFunction<KBPsK>::apply(const Position& pos) {
assert(pos.non_pawn_material(strongerSide) == BishopValueMidgame);
assert(pos.piece_count(strongerSide, BISHOP) == 1);
// The bishop has the wrong color, and the defending king is on the
// file of the pawn(s) or the neighboring file. Find the rank of the
// frontmost pawn.
-
Rank rank;
if (strongerSide == WHITE)
{
/// It tests for fortress draws with a rook on the third rank defended by
/// a pawn.
template<>
-ScaleFactor ScalingFunction<KQKRP>::apply(const Position& pos) {
+ScaleFactor ScalingFunction<KQKRPs>::apply(const Position& pos) {
assert(pos.non_pawn_material(strongerSide) == QueenValueMidgame);
assert(pos.piece_count(strongerSide, QUEEN) == 1);