mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Bonus for rook behind a passed
If our rook is behind a passed pawn, all squares are defended. One of the longest tests to pass ! Passed both short TC LLR: 2.97 (-2.94,2.94) Total: 44560 W: 9518 L: 9281 D: 25761 And long TC LLR: 2.96 (-2.94,2.94) Total: 61348 W: 11618 L: 11192 D: 38538 bench: 3787694
This commit is contained in:
parent
a0cf424cfc
commit
4b9e338541
1 changed files with 6 additions and 1 deletions
|
@ -826,7 +826,6 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
|||
if (pos.is_empty(blockSq))
|
||||
{
|
||||
squaresToQueen = forward_bb(Us, s);
|
||||
defendedSquares = squaresToQueen & ei.attackedBy[Us][ALL_PIECES];
|
||||
|
||||
// If there is an enemy rook or queen attacking the pawn from behind,
|
||||
// add all X-ray attacks by the rook or queen. Otherwise consider only
|
||||
|
@ -837,6 +836,12 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
|||
else
|
||||
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));
|
||||
|
||||
if ( unlikely(forward_bb(Them, s) & pos.pieces(Us, ROOK, QUEEN))
|
||||
&& (forward_bb(Them, s) & pos.pieces(Us, ROOK, QUEEN) & pos.attacks_from<ROOK>(s)))
|
||||
defendedSquares = squaresToQueen;
|
||||
else
|
||||
defendedSquares = squaresToQueen & ei.attackedBy[Us][ALL_PIECES];
|
||||
|
||||
// If there aren't enemy attacks huge bonus, a bit smaller if at
|
||||
// least block square is not attacked, otherwise smallest bonus.
|
||||
int k = !unsafeSquares ? 15 : !(unsafeSquares & blockSq) ? 9 : 3;
|
||||
|
|
Loading…
Add table
Reference in a new issue