Skip to content

Commit

Permalink
bench: 5038410
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtor committed Jan 10, 2018
1 parent 7a50277 commit 9d40150
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/evaluate.cpp
Expand Up @@ -431,13 +431,11 @@ namespace {
// King shelter and enemy pawns storm
Score score = pe->king_safety<Us>(pos, ksq);

// King opposition
if (!pos.non_pawn_material(Them)) {
if (pos.side_to_move() == Them && distance(ksq, pos.square<KING>(Them)) == 2) {
Bitboard bp= (Them == WHITE ? shift<NORTH> : shift<SOUTH>)(pos.pieces(Them, PAWN));
if ((bp & pos.pieces()) == bp) // Zugzwang
score+= make_score(0, 12);
}
// King zugzwang
if (!pos.non_pawn_material(Them) && pos.side_to_move() == Them) {
Bitboard bp= (Them == WHITE ? shift<NORTH> : shift<SOUTH>)(pos.pieces(Them, PAWN));
if ((bp & pos.pieces()) == bp)
score+= make_score(0, 16);
}

// Main king safety evaluation
Expand Down

0 comments on commit 9d40150

Please sign in to comment.