Skip to content

Commit

Permalink
take 6 (with queen checks)
Browse files Browse the repository at this point in the history
Bench: 4926153
  • Loading branch information
snicolet committed Jul 11, 2018
1 parent 943be01 commit 6701302
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/evaluate.cpp
Expand Up @@ -437,6 +437,12 @@ namespace {
safe = ~pos.pieces(Them);
safe &= ~attackedBy[Us][ALL_PIECES] | (weak & attackedBy2[Them]);

// Add some demolition checks
safe |= pos.pieces(Us)
& ~attackedBy[Us][PAWN]
& attackedBy2[Them]
& ~attackedBy2[Us];

b1 = attacks_bb<ROOK >(ksq, pos.pieces() ^ pos.pieces(Us, QUEEN));
b2 = attacks_bb<BISHOP>(ksq, pos.pieces() ^ pos.pieces(Us, QUEEN));

Expand All @@ -447,12 +453,6 @@ namespace {
b1 &= attackedBy[Them][ROOK];
b2 &= attackedBy[Them][BISHOP];

// Add some demolition checks
safe |= pos.pieces(Us)
& ~attackedBy[Us][PAWN]
& attackedBy2[Them]
& ~attackedBy2[Us];

// Enemy rooks checks
if (b1 & safe)
kingDanger += RookSafeCheck;
Expand Down

0 comments on commit 6701302

Please sign in to comment.