Skip to content

Commit

Permalink
Add threat if pawn is protected by another pawn
Browse files Browse the repository at this point in the history
  • Loading branch information
MJZ1977 committed Aug 19, 2018
1 parent f3b8a69 commit ed68182
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/evaluate.cpp
Expand Up @@ -580,7 +580,7 @@ namespace {
b |= shift<Up>(b & TRank3BB) & ~pos.pieces();

// Keep only the squares which are relatively safe
b &= ~attackedBy[Them][PAWN] & safe;
b &= (~attackedBy[Them][PAWN] | attackedBy[Us][PAWN]) & safe;

// Bonus for safe pawn threats on the next move
b = pawn_attacks_bb<Us>(b) & pos.pieces(Them);
Expand Down

3 comments on commit ed68182

@snicolet
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see these ideas with the removal of pawn threats from pinned pawns, like in this test:

snicolet/Stockfish@f3b8a69...f7127f2
http://tests.stockfishchess.org/tests/view/5b787e180ebc5902bdbaba64

It seems likely that removing illegal threats from the bonus can only be beneficial.

@MJZ1977
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree !
But a lot of good ideas don't work so well because SF find the right move with only calculation power.

@MJZ1977
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added your commit for a test.
Another special case : prise en passant. I will see this another time.

Please sign in to comment.