Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WeakUnopposed penalty for backwards on file A or H #3275

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/pawns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ namespace {
#define S(mg, eg) make_score(mg, eg)

// Pawn penalties
constexpr Score Backward = S( 8, 25);
constexpr Score Doubled = S(10, 55);
constexpr Score Isolated = S( 3, 15);
constexpr Score WeakLever = S( 3, 55);
constexpr Score WeakUnopposed = S(13, 25);
constexpr Score Backward = S( 6, 23);
constexpr Score Doubled = S(13, 53);
constexpr Score Isolated = S( 2, 15);
constexpr Score WeakLever = S( 5, 57);
constexpr Score WeakUnopposed = S(16, 22);

// Bonus for blocked pawns at 5th or 6th rank
constexpr Score BlockedPawn[2] = { S(-15, -3), S(-6, 3) };
Expand Down Expand Up @@ -69,8 +69,8 @@ namespace {

// KingOnFile[semi-open Us][semi-open Them] contains bonuses/penalties
// for king when the king is on a semi-open or open file.
constexpr Score KingOnFile[2][2] = {{ S(-19,12), S(-6, 7) },
{ S( 0, 2), S( 6,-5) }};
constexpr Score KingOnFile[2][2] = {{ S(-21,10), S(-7, 1) },
{ S( 0,-3), S( 9,-4) }};

#undef S
#undef V
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace {

else if (backward)
score -= Backward
+ WeakUnopposed * !opposed;
+ WeakUnopposed * !opposed * bool(~(FileABB | FileHBB) & s);

if (!support)
score -= Doubled * doubled
Expand Down