Fix: Checkmate evaluation was reversed, therefore there was no will to checkmate on either side

master
Dany Thach 2025-02-16 00:00:51 +01:00
parent 278e5092e6
commit da28e94c01
1 changed files with 2 additions and 2 deletions

View File

@ -13,8 +13,8 @@ class BestMoveSearcher {
static int getPositionBaseValue(Position position) { static int getPositionBaseValue(Position position) {
if (LegalMoves.isCheckmate(position)) { if (LegalMoves.isCheckmate(position)) {
return position.isWhiteTurn return position.isWhiteTurn
? Numbers.maxInteger ? Numbers.minInteger
: Numbers.minInteger; : Numbers.maxInteger;
} }
int value = 0; int value = 0;
List<int> whitePawnFiles = List.filled(8, 0, growable: false); // isolated pawns, doubled pawns List<int> whitePawnFiles = List.filled(8, 0, growable: false); // isolated pawns, doubled pawns