Skip to content

Commit 37ffacf

Browse files
Vizvezdenecsnicolet
authored andcommitted
More bonus for free passed pawn
Give even more bonus to passed pawn if adjacent squares to its path are not attacked. passed STC http://tests.stockfishchess.org/tests/view/5d08c9b10ebc5925cf0a6630 LLR: 2.95 (-2.94,2.94) [0.50,4.50] Total: 175197 W: 39859 L: 38816 D: 96522 passed LTC http://tests.stockfishchess.org/tests/view/5d0ab8240ebc5925cf0a8fe4 LLR: 2.95 (-2.94,2.94) [0.00,3.50] Total: 92928 W: 16124 L: 15682 D: 61122 Bench: 3398333
1 parent 8bf21a7 commit 37ffacf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/evaluate.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ namespace {
605605
};
606606

607607
Bitboard b, bb, squaresToQueen, defendedSquares, unsafeSquares;
608+
Bitboard wideUnsafeSquares;
608609
Score score = SCORE_ZERO;
609610

610611
b = pe->passed_pawns(Us);
@@ -639,6 +640,7 @@ namespace {
639640
// consider all the squaresToQueen. Otherwise consider only the squares
640641
// in the pawn's path attacked or occupied by the enemy.
641642
defendedSquares = unsafeSquares = squaresToQueen = forward_file_bb(Us, s);
643+
wideUnsafeSquares = AllSquares;
642644

643645
bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN);
644646

@@ -647,10 +649,14 @@ namespace {
647649

648650
if (!(pos.pieces(Them) & bb))
649651
unsafeSquares &= attackedBy[Them][ALL_PIECES] | pos.pieces(Them);
652+
653+
if (!unsafeSquares)
654+
wideUnsafeSquares = (attackedBy[Them][ALL_PIECES] | pos.pieces(Them))
655+
& (shift<WEST>(squaresToQueen) | shift<EAST>(squaresToQueen));
650656

651657
// If there aren't any enemy attacks, assign a big bonus. Otherwise
652658
// assign a smaller bonus if the block square isn't attacked.
653-
int k = !unsafeSquares ? 20 : !(unsafeSquares & blockSq) ? 9 : 0;
659+
int k = !wideUnsafeSquares ? 35 : !unsafeSquares ? 20 : !(unsafeSquares & blockSq) ? 9 : 0;
654660

655661
// Assign a larger bonus if the block square is defended.
656662
if (defendedSquares & blockSq)

0 commit comments

Comments
 (0)