Bonus for threats by shogi pawns
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 28 Nov 2018 13:59:38 +0000 (14:59 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 28 Nov 2018 13:59:38 +0000 (14:59 +0100)
shogi
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 1510 W: 787 L: 666 D: 57

minishogi
LLR: 2.96 (-2.94,2.94) [-10.00,5.00]
Total: 1544 W: 744 L: 691 D: 109

src/evaluate.cpp

index 673ecb4..e79b8f1 100644 (file)
@@ -620,7 +620,7 @@ namespace {
     b =   pos.pieces(Us, PAWN)
        & (~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES]);
 
-    safeThreats = pawn_attacks_bb<Us>(b) & nonPawnEnemies;
+    safeThreats = (pawn_attacks_bb<Us>(b) | shift<Up>(pos.pieces(Us, SHOGI_PAWN))) & nonPawnEnemies;
     score += ThreatBySafePawn * popcount(safeThreats);
 
     // Find squares where our pawns can push on the next move