From 9c305808704da692af3255a21f18cb8b975b2490 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 11 Aug 2026 16:55:10 +0200 Subject: fixing syntax bugs --- src/evaluate.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d2ee734..3958999 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -80,19 +80,18 @@ static std::array KING_TABLE_EARLY = { 20, 30, 10, 0, 0, 10, 30, 20, // }; -static std::array KING_TABLE_LATE = - { - -50, -40, -30, -20, -20, -30, -40, -50, // - -30, -20, -10, 0, 0, -10, -20, -30, // - -30, -10, 20, 30, 30, 20, -10, -30, // - -30, -10, 30, 40, 40, 30, -10, -30, // - -30, -10, 30, 40, 40, 30, -10, -30, // - -30, -10, 20, 30, 30, 20, -10, -30, // - -30, -30, 0, 0, 0, 0, -30, -30, // - -50, -30, -30, -30, -30, -30, -30, -50, // -} +static std::array KING_TABLE_LATE = { + -50, -40, -30, -20, -20, -30, -40, -50, // + -30, -20, -10, 0, 0, -10, -20, -30, // + -30, -10, 20, 30, 30, 20, -10, -30, // + -30, -10, 30, 40, 40, 30, -10, -30, // + -30, -10, 30, 40, 40, 30, -10, -30, // + -30, -10, 20, 30, 30, 20, -10, -30, // + -30, -30, 0, 0, 0, 0, -30, -30, // + -50, -30, -30, -30, -30, -30, -30, -50, // +}; -int EvaluateBoard(Game * g) { +int EvaluateBoard(Game *g) { int score = EvaluateBoardForWhite(g); return g->turn ? score : score * -1; }; @@ -221,7 +220,7 @@ int EvaluateBoardForWhite(Game *g) { int score = 0; bool isEndGame = IsEndgame(g); - score += CountBoardMaterial(g); + score += CountBoardMaterial(g, isEndGame); if (isEndGame) { Position whiteKing = FindKing(g, true); -- cgit v1.2.3