1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 09:39:36 +00:00

Small simplification to passed pawns

Tested in no-regression mode.

Passed both STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 28521 W: 5066 L: 4958 D: 18497

And LTC
LLR: 3.04 (-2.94,2.94) [-3.00,1.00]
Total: 21939 W: 3261 L: 3138 D: 15540

bench: 8165681
This commit is contained in:
Arjun Temurnikar 2014-04-17 21:41:22 -07:00 committed by Marco Costalba
parent 619d66b7ab
commit a4d058bca2

View file

@ -633,19 +633,17 @@ namespace {
else else
defendedSquares = squaresToQueen & ei.attackedBy[Us][ALL_PIECES]; defendedSquares = squaresToQueen & ei.attackedBy[Us][ALL_PIECES];
// If there aren't any enemy attacks, then assign a huge bonus. // If there aren't any enemy attacks, assign a big bonus. Otherwise
// The bonus will be a bit smaller if at least the block square // assign a smaller bonus if the block square isn't attacked.
// isn't attacked, otherwise assign the smallest possible bonus. int k = !unsafeSquares ? 15 : !(unsafeSquares & blockSq) ? 9 : 0;
int k = !unsafeSquares ? 15 : !(unsafeSquares & blockSq) ? 9 : 3;
// Assign a big bonus if the path to the queen is fully defended, // If the path to queen is fully defended, assign a big bonus.
// otherwise assign a bit less of a bonus if at least the block // Otherwise assign a smaller bonus if the block square is defended.
// square is defended.
if (defendedSquares == squaresToQueen) if (defendedSquares == squaresToQueen)
k += 6; k += 6;
else if (defendedSquares & blockSq) else if (defendedSquares & blockSq)
k += (unsafeSquares & defendedSquares) == unsafeSquares ? 4 : 2; k += 4;
mbonus += Value(k * rr), ebonus += Value(k * rr); mbonus += Value(k * rr), ebonus += Value(k * rr);
} }