Skip to content

Commit

Permalink
Improve the Chess960 correction for cornered bishops
Browse files Browse the repository at this point in the history
As Chess960 patches can not be tested on fishtest, this was locally tuned
and tested:

Elo: 2.36 +- 1.07
LOS: 0.999992

closes #3730

Bench: 5714575
  • Loading branch information
vondele authored and snicolet committed Oct 6, 2021
1 parent 371b522 commit 329bdbd
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,26 +1053,22 @@ namespace {

if ( pos.piece_on(SQ_A1) == W_BISHOP
&& pos.piece_on(SQ_B2) == W_PAWN)
correction += !pos.empty(SQ_B3) ? -CorneredBishop * 4
: -CorneredBishop * 3;
correction -= CorneredBishop;

if ( pos.piece_on(SQ_H1) == W_BISHOP
&& pos.piece_on(SQ_G2) == W_PAWN)
correction += !pos.empty(SQ_G3) ? -CorneredBishop * 4
: -CorneredBishop * 3;
correction -= CorneredBishop;

if ( pos.piece_on(SQ_A8) == B_BISHOP
&& pos.piece_on(SQ_B7) == B_PAWN)
correction += !pos.empty(SQ_B6) ? CorneredBishop * 4
: CorneredBishop * 3;
correction += CorneredBishop;

if ( pos.piece_on(SQ_H8) == B_BISHOP
&& pos.piece_on(SQ_G7) == B_PAWN)
correction += !pos.empty(SQ_G6) ? CorneredBishop * 4
: CorneredBishop * 3;
correction += CorneredBishop;

return pos.side_to_move() == WHITE ? Value(correction)
: -Value(correction);
return pos.side_to_move() == WHITE ? Value(5 * correction)
: -Value(5 * correction);
}

} // namespace Eval
Expand Down

0 comments on commit 329bdbd

Please sign in to comment.