constexpr Score WeakLever = S( 0, 56);
constexpr Score WeakUnopposed = S(13, 27);
+ // Bonus for blocked pawns at 5th or 6th rank
+ constexpr Score BlockedPawn[2] = { S(-11, -4), S(-3, 4) };
+
constexpr Score BlockedStorm[RANK_NB] = {
S(0, 0), S(0, 0), S(76, 78), S(-10, 15), S(-7, 10), S(-4, 6), S(-1, 2)
};
// Score this pawn
if (support | phalanx)
{
- int v = Connected[r] * (4 + 2 * bool(phalanx) - 2 * bool(opposed) - bool(blocked)) / 2
+ int v = Connected[r] * (2 + bool(phalanx) - bool(opposed))
+ 21 * popcount(support);
score += make_score(v, v * (r - 2) / 4);
if (!support)
score -= Doubled * doubled
+ WeakLever * more_than_one(lever);
+
+ if (blocked && r > RANK_4)
+ score += BlockedPawn[r-4];
}
return score;