Evaluate shogi pawn promotion checks
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 13 Jan 2021 18:22:48 +0000 (19:22 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 13 Jan 2021 18:22:48 +0000 (19:22 +0100)
shogi STC
LLR: -2.97 (-2.94,2.94) [0.00,10.00]
Total: 11377 W: 5693 L: 5632 D: 52
http://www.variantfishtest.org:6543/tests/view/5fe9debf6e23db221d9e9705

shogi LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 17659 W: 8964 L: 8608 D: 87
http://www.variantfishtest.org:6543/tests/view/5fef28506e23db221d9e9812

src/evaluate.cpp

index ccfd4d7..239cf2e 100644 (file)
@@ -725,6 +725,16 @@ namespace {
             }
             break;
         case SHOGI_PAWN:
+            if (pos.promoted_piece_type(pt))
+            {
+                otherChecks = attacks_bb(Us, pos.promoted_piece_type(pt), ksq, pos.pieces()) & attackedBy[Them][pt]
+                                 & zone_bb(Them, pos.promotion_rank(), pos.max_rank()) & pos.board_bb();
+                if (otherChecks & safe)
+                    kingDanger += SafeCheck[FAIRY_PIECES][more_than_one(otherChecks & safe)];
+                else
+                    unsafeChecks |= otherChecks;
+            }
+            break;
         case KING:
             break;
         default: