Skip to content

Commit

Permalink
include neighbours for backward pawns.
Browse files Browse the repository at this point in the history
bench 5122789
  • Loading branch information
protonspring committed May 5, 2018
1 parent 4a8dab3 commit 9bb7b52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pawns.cpp
Expand Up @@ -118,8 +118,8 @@ namespace {

// A pawn is backward when it is behind all pawns of the same color
// on the adjacent files and cannot be safely advanced.
backward = !lever && !(ourPawns & pawn_attack_span(Them, s+Up))
&& (stoppers & (leverPush | (s+Up)));
backward = !lever && !(ourPawns & pawn_attack_span(Them, s+Up)) &&
neighbours && (stoppers & (leverPush | (s+Up)));

// Passed pawns will be properly scored in evaluation because we need
// full attack info to evaluate them. Include also not passed pawns
Expand Down

3 comments on commit 9bb7b52

@Rocky640
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly same bench as your other test. No need to test the same thing twice.

@protonspring
Copy link
Owner

@protonspring protonspring commented on 9bb7b52 May 5, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rocky640
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not always, but in this case yes.
As I said, we score backward only if !neighbours

else if (!neighbours)
            score -= Isolated, e->weakUnopposed[Us] += !opposed;

        else if (backward)
            score -= Backward, e->weakUnopposed[Us] += !opposed;

Please sign in to comment.