Skip to content

Commit

Permalink
Use stronglyProtected
Browse files Browse the repository at this point in the history
~stronglyProtected is quite similar to ~attackedBy[Them][PAWN] & ~attackedBy2[Them],
the only difference appears to be that the former includes squares attacked twice
by both sides. The resulting logic is simpler, and the change appears to be at least
Elo-neutral at both STC and LTC.

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 35924 W: 7978 L: 7885 D: 20061
http://tests.stockfishchess.org/tests/view/5c14a5c00ebc5902ba11ed72

LTC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 37078 W: 6125 L: 6030 D: 24923
http://tests.stockfishchess.org/tests/view/5c14ae880ebc5902ba11eed8

Bench: 3646542
  • Loading branch information
31m059 authored and snicolet committed Dec 16, 2018
1 parent 64a6138 commit 7240a90
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,7 @@ namespace {

// Bonus for restricting their piece moves
restricted = attackedBy[Them][ALL_PIECES]
& ~attackedBy[Them][PAWN]
& ~attackedBy2[Them]
& ~stronglyProtected
& attackedBy[Us][ALL_PIECES];
score += RestrictedPiece * popcount(restricted);

Expand Down

0 comments on commit 7240a90

Please sign in to comment.