diff options
| author | Adam <adammegarules1@gmail.com> | 2026-08-11 16:55:10 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-08-11 16:55:10 +0200 |
| commit | 9c305808704da692af3255a21f18cb8b975b2490 (patch) | |
| tree | 74ca0ab397dfd42f951783dc6df36e3e0c2a92a6 | |
| parent | 1cf875772801fd3315acd2497ac3652bb97fa307 (diff) | |
fixing syntax bugs
| -rw-r--r-- | src/evaluate.cpp | 25 |
1 files 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<int, 64> KING_TABLE_EARLY = { 20, 30, 10, 0, 0, 10, 30, 20, // }; -static std::array<int, 64> 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<int, 64> 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); |
