diff options
Diffstat (limited to 'src')
| -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); |
