Skip to content

Commit

Permalink
Small simplification to passed pawns
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Arjun Temurnikar authored and mcostalba committed Apr 20, 2014
1 parent 619d66b commit a4d058b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/evaluate.cpp
Expand Up @@ -633,19 +633,17 @@ namespace {
else
defendedSquares = squaresToQueen & ei.attackedBy[Us][ALL_PIECES];

// If there aren't any enemy attacks, then assign a huge bonus.
// The bonus will be a bit smaller if at least the block square
// isn't attacked, otherwise assign the smallest possible bonus.
int k = !unsafeSquares ? 15 : !(unsafeSquares & blockSq) ? 9 : 3;

// Assign a big bonus if the path to the queen is fully defended,
// otherwise assign a bit less of a bonus if at least the block
// square is defended.
// If there aren't any enemy attacks, assign a big bonus. Otherwise
// assign a smaller bonus if the block square isn't attacked.
int k = !unsafeSquares ? 15 : !(unsafeSquares & blockSq) ? 9 : 0;

// If the path to queen is fully defended, assign a big bonus.
// Otherwise assign a smaller bonus if the block square is defended.
if (defendedSquares == squaresToQueen)
k += 6;

else if (defendedSquares & blockSq)
k += (unsafeSquares & defendedSquares) == unsafeSquares ? 4 : 2;
k += 4;

mbonus += Value(k * rr), ebonus += Value(k * rr);
}
Expand Down

0 comments on commit a4d058b

Please sign in to comment.