+/// K, knight and a pawn vs K and bishop. If knight can block bishop from taking
+/// pawn, it's a win. Otherwise, drawn.
+template<>
+ScaleFactor Endgame<KNPKB>::operator()(const Position& pos) const {
+
+ Square pawnSq = pos.list<PAWN>(strongerSide)[0];
+ Square bishopSq = pos.list<BISHOP>(weakerSide)[0];
+ Square weakerKingSq = pos.king_square(weakerSide);
+
+ // King needs to get close to promoting pawn to prevent knight from blocking.
+ // Rules for this are very tricky, so just approximate.
+ if (forward_bb(strongerSide, pawnSq) & pos.attacks_from<BISHOP>(bishopSq))
+ return ScaleFactor(square_distance(weakerKingSq, pawnSq));
+
+ return SCALE_FACTOR_NONE;
+}
+
+