aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-08-11 16:55:10 +0200
committerAdam <adammegarules1@gmail.com>2026-08-11 16:55:10 +0200
commit9c305808704da692af3255a21f18cb8b975b2490 (patch)
tree74ca0ab397dfd42f951783dc6df36e3e0c2a92a6 /src
parent1cf875772801fd3315acd2497ac3652bb97fa307 (diff)
fixing syntax bugs
Diffstat (limited to 'src')
-rw-r--r--src/evaluate.cpp25
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);