diff options
| author | Adam <adammegarules1@gmail.com> | 2026-08-01 08:58:05 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-08-01 08:58:05 +0200 |
| commit | 61bbd36293516e122297dc9d157b3b8ee886fab6 (patch) | |
| tree | 6a58a6c686ed1a990e765d2d1745c13dd0c92b55 /src/evaluate.cpp | |
| parent | 839b4740af77743c7141e113eb7f110b4f6a9983 (diff) | |
cleaning code
Diffstat (limited to 'src/evaluate.cpp')
| -rw-r--r-- | src/evaluate.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 3e4f72f..8b9ff3d 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -78,6 +78,11 @@ static int KING_TABLE_EARLY[64] = { 20, 30, 10, 0, 0, 10, 30, 20, // }; +int EvaluateBoard(Game *g) { + int score = EvaluateBoardForWhite(g); + return g->turn ? score : score * -1; +}; + /* * i cound have come up with better name. * this function just takes square and if color is black rotate it @@ -181,7 +186,8 @@ bool IsEndgame(const Game *g) { } int EvaluateBoardForWhite(Game *g) { - switch (GetNewGameState(g)) { + g->state = GetNewGameState(g); + switch (g->state) { case WHITE_WON: return MATE; case BLACK_WON: |
