Simplify evaluation of passed shogi pawns
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 10 Feb 2019 20:03:06 +0000 (21:03 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 10 Feb 2019 20:03:06 +0000 (21:03 +0100)
shogi
LLR: 1.60 (-2.94,2.94) [-10.00,5.00]
Total: 1000 W: 502 L: 473 D: 25

src/evaluate.cpp

index be5de8f..1b65bed 100644 (file)
@@ -838,7 +838,7 @@ namespace {
 
             Square blockSq = s + Up;
             int d = std::max(pos.promotion_rank() - relative_rank(Us, s, pos.max_rank()), 1);
-            d += !!(pos.pieces(Us) & blockSq) + !!(attackedBy[Them][ALL_PIECES] & ~attackedBy2[Us] & blockSq);
+            d += !!(attackedBy[Them][ALL_PIECES] & ~attackedBy2[Us] & blockSq);
             score += make_score(PieceValue[MG][pt], PieceValue[EG][pt]) / (4 * d * d);
         }
     }