Bitboard Position::attackers_to_pseudo_royals(Color c) const {
Bitboard attackers = 0;
Bitboard pseudoRoyals = st->pseudoRoyals & pieces(~c);
+ Bitboard pseudoRoyalsTheirs = st->pseudoRoyals & pieces(c);
while (pseudoRoyals) {
Square sr = pop_lsb(pseudoRoyals);
+ if (blast_on_capture()
+ && pseudoRoyalsTheirs & attacks_bb<KING>(sr))
+ // skip if capturing this piece would blast all of the attacker's pseudo-royal pieces
+ continue;
attackers |= attackers_to(sr, c);
}
return attackers;
result = sf.gives_check("atomic", "rnbqkbnr/ppp2ppp/8/8/8/8/PPP2PPP/RNBQKBNR w KQkq - 0 4", ["d1d7"])
self.assertTrue(result)
+ result = sf.gives_check("atomic", "8/8/kK6/8/8/8/Q7/8 b - - 0 1", [])
+ self.assertFalse(result)
+
def test_game_result(self):
result = sf.game_result("chess", CHESS, ["f2f3", "e7e5", "g2g4", "d8h4"])
self.assertEqual(result, -sf.VALUE_MATE)
board.setFen("rnbqkbnr/ppp2ppp/8/8/8/8/PPP2PPP/RNBQKBNR w KQkq - 0 4");
board.pushSan("Qd7");
chai.expect(board.isCheck()).to.equal(true);
+ board.setFen("8/8/kK6/8/8/8/Q7/8 b - - 0 1")
+ chai.expect(board.isCheck()).to.equal(false);
board.delete();
});
});