Skip to content

Commit

Permalink
Tweak duck chess KPK
Browse files Browse the repository at this point in the history
  • Loading branch information
ianfab committed Aug 21, 2024
1 parent 58ebdff commit 02be619
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/endgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,13 +1240,11 @@ Value Endgame<KPK, EG_EVAL_DUCK>::operator()(const Position& pos) const {
Square weakKing = pos.square<COMMONER>(weakSide);
Square strongPawn = pos.square<PAWN>(strongSide);

Value result = PawnValueEg + 10 * relative_rank(strongSide, strongPawn, pos.max_rank())
Value result = PawnValueEg + 50 * relative_rank(strongSide, strongPawn, pos.max_rank())
+ push_to_edge(weakKing, pos)
+ push_close(strongKing, weakKing);

// Pawn can be protected
if (distance(strongKing, strongPawn) < distance(weakKing, strongPawn))
result += VALUE_KNOWN_WIN;
+ push_close(strongKing, weakKing)
+ push_close(strongKing, strongPawn) / 2
+ push_away(weakKing, strongPawn) / 2;

return strongSide == pos.side_to_move() ? result : -result;
}
Expand Down

0 comments on commit 02be619

Please sign in to comment.