Skip to content
Permalink
Browse files

Fawn on one side, passer on other. Bench: 3449144

  • Loading branch information...
31m059 committed Jan 9, 2019
1 parent 1a0075d commit 7dd0f9b3d6be4ee58fffb0985634a26f55339870
Showing with 16 additions and 5 deletions.
  1. +9 −0 src/evaluate.cpp
  2. +6 −5 src/pawns.cpp
  3. +1 −0 src/pawns.h
@@ -484,6 +484,15 @@ namespace {

// King tropism bonus, to anticipate slow motion attacks on our king
score -= CloseEnemies * tropism;

// If our king and an enemy fawn pawn are on one side,
// and the enemy has a passer on the other, large penalty.
constexpr Bitboard ABC = FileABB | FileBBB | FileCBB;
constexpr Bitboard FGH = FileFBB | FileGBB | FileHBB;
if ( (FGH & ksq && pe->fawnpawn[Them][0] && ABC & pe->passed_pawns(Them))
|| (ABC & ksq && pe->fawnpawn[Them][1] && FGH & pe->passed_pawns(Them)))
score -= make_score(50, 50);


if (T)
Trace::add(KING, Us, score);
@@ -35,7 +35,6 @@ namespace {
constexpr Score Backward = S( 9, 24);
constexpr Score Doubled = S(11, 56);
constexpr Score Isolated = S( 5, 15);
constexpr Score FawnPawn = S(20, 30);

// Connected pawn bonus by opposed, phalanx, #support and rank
Score Connected[2][2][3][RANK_NB];
@@ -142,10 +141,12 @@ namespace {
score -= Doubled;
}

if ( pos.pieces(~Us, PAWN) & relative_square(Us, SQ_H3)
&& pos.pieces(Us, PAWN) & relative_square(Us, SQ_H2)
&& !(pos.pieces(Us, PAWN) & relative_square(Us, SQ_G2)))
score -= FawnPawn;
e->fawnpawn[~Us][0] = pos.pieces(~Us, PAWN) & relative_square(Us, SQ_H3)
&& pos.pieces(Us, PAWN) & relative_square(Us, SQ_H2)
&& pos.pieces(Us, PAWN) & relative_square(Us, SQ_G3);
e->fawnpawn[~Us][1] = pos.pieces(~Us, PAWN) & relative_square(Us, SQ_A3)
&& pos.pieces(Us, PAWN) & relative_square(Us, SQ_A2)
&& pos.pieces(Us, PAWN) & relative_square(Us, SQ_B3);

return score;
}
@@ -71,6 +71,7 @@ struct Entry {
int castlingRights[COLOR_NB];
int semiopenFiles[COLOR_NB];
int pawnsOnSquares[COLOR_NB][COLOR_NB]; // [color][light/dark squares]
bool fawnpawn[COLOR_NB][COLOR_NB]; // [color][king/queen side]
int asymmetry;
};

0 comments on commit 7dd0f9b

Please sign in to comment.
You can’t perform that action at this time.