Skip to content

Commit 36e4a86

Browse files
xoto10snicolet
authored andcommitted
Bonus for rook on same file as their queen
This patch creates a simple bonus for a rook that is on the same file as the opponent's queen. STC 10+0.1 th 1 : LLR: 2.95 (-2.94,2.94) [0.50,4.50] Total: 45609 W: 10120 L: 9733 D: 25756 http://tests.stockfishchess.org/tests/view/5d79895a0ebc5902d385484a LTC 60+0.6 th 1 : LLR: 2.96 (-2.94,2.94) [0.00,3.50] Total: 51651 W: 8606 L: 8288 D: 34757 http://tests.stockfishchess.org/tests/view/5d79a0850ebc5902d3854d27 Many thanks to @noobpwnftw for providing the extra cpu resources for fishtest, which led to me doing these tests. Closes #2297 Bench: 4024461
1 parent 270b241 commit 36e4a86

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/evaluate.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ namespace {
140140
constexpr Score PawnlessFlank = S( 17, 95);
141141
constexpr Score RestrictedPiece = S( 7, 7);
142142
constexpr Score RookOnPawn = S( 10, 32);
143+
constexpr Score RookOnQueenFile = S( 11, 4);
143144
constexpr Score SliderOnQueen = S( 59, 18);
144145
constexpr Score ThreatByKing = S( 24, 89);
145146
constexpr Score ThreatByPawnPush = S( 48, 39);
@@ -346,6 +347,10 @@ namespace {
346347
if (relative_rank(Us, s) >= RANK_5)
347348
score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]);
348349

350+
// Bonus for rook on same file as their queen
351+
if (file_bb(s) & pos.pieces(Them, QUEEN))
352+
score += RookOnQueenFile;
353+
349354
// Bonus for rook on an open or semi-open file
350355
if (pos.is_on_semiopen_file(Us, s))
351356
score += RookOnFile[bool(pos.is_on_semiopen_file(Them, s))];

0 commit comments

Comments
 (0)