Skip to content

Commit

Permalink
twig.
Browse files Browse the repository at this point in the history
bench 3375486
  • Loading branch information
Vizvezdenec committed Nov 8, 2018
1 parent a6fe035 commit 898e3b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/evaluate.cpp
Expand Up @@ -156,6 +156,7 @@ namespace {

// Assorted bonuses and penalties
constexpr Score BishopPawns = S( 3, 7);
constexpr Score BishopPawns1 = S( 2, 4);
constexpr Score CloseEnemies = S( 6, 0);
constexpr Score CorneredBishop = S( 50, 50);
constexpr Score Hanging = S( 57, 32);
Expand Down Expand Up @@ -345,9 +346,11 @@ namespace {
// Penalty according to number of pawns on the same color square as the
// bishop, bigger when the center files are blocked with pawns.
Bitboard blocked = pos.pieces(Us, PAWN) & shift<Down>(pos.pieces());

Bitboard protectedPawns = pos.pieces(Them, PAWN) & attackedBy[Them][PAWN] & ~attackedBy[Us][PAWN];
score -= BishopPawns * pe->pawns_on_same_color_squares(Us, s)
* (1 + popcount(blocked & CenterFiles));
score -= BishopPawns1 * pe->pawns_on_same_color_squares(Them, s)
* popcount(protectedPawns & CenterFiles);

// Bonus for bishop on a long diagonal which can "see" both center squares
if (more_than_one(attacks_bb<BISHOP>(s, pos.pieces(PAWN)) & Center))
Expand Down

0 comments on commit 898e3b8

Please sign in to comment.