Skip to content

Commit

Permalink
Avoid engames with blocked center and lots of pawns
Browse files Browse the repository at this point in the history
  • Loading branch information
snicolet committed Mar 12, 2018
1 parent 6e9337b commit 0ddd1a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/evaluate.cpp
Expand Up @@ -172,6 +172,7 @@ namespace {
const Score LongRangedBishop = S( 22, 0);
const Score MinorBehindPawn = S( 16, 0);
const Score PawnlessFlank = S( 20, 80);
const Score PawnMobility = S( 0, 8);
const Score RookOnPawn = S( 8, 24);
const Score SliderOnQueen = S( 42, 21);
const Score ThreatByPawnPush = S( 47, 26);
Expand Down Expand Up @@ -577,6 +578,10 @@ namespace {
b &= ~attackedBy[Them][PAWN]
& (attackedBy[Us][ALL_PIECES] | ~attackedBy[Them][ALL_PIECES]);

// Pawn mobility, to keep fluidity of position
if (pos.count<PAWN>() >= 10)
score += PawnMobility * popcount(b & CenterFiles);

// Bonus for safe pawn threats on the next move
b = pawn_attacks_bb<Us>(b)
& pos.pieces(Them)
Expand Down

0 comments on commit 0ddd1a7

Please sign in to comment.