diff --git a/source/evaluate.cpp b/source/evaluate.cpp index 6c7cb31..37ab761 100644 --- a/source/evaluate.cpp +++ b/source/evaluate.cpp @@ -1,5 +1,7 @@ #include "evaluate.h" +namespace HCE { + static int GetPhaseWeight(Board &board, int color) { int phase = 0; @@ -60,3 +62,4 @@ int Evaluate(Board &board) { return board.sideToMove ? -score : score; } +} \ No newline at end of file diff --git a/source/evaluate.h b/source/evaluate.h index 5bec50d..0f2514c 100644 --- a/source/evaluate.h +++ b/source/evaluate.h @@ -1,6 +1,8 @@ #pragma once #include "board.h" +namespace HCE { + constexpr int phaseMax = 24; constexpr int phaseValues[4] { @@ -154,4 +156,5 @@ constexpr int scoreSquares[64] { a1, b1, c1, d1, e1, f1, g1, h1 }; -int Evaluate(Board &board); \ No newline at end of file +int Evaluate(Board &board); +} diff --git a/source/search.cpp b/source/search.cpp index 33f7db9..21085ea 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -118,7 +118,7 @@ static SearchResults Quiescence(Board board, int alpha, int beta, int ply) { } } - int bestScore = Evaluate(board); + int bestScore = HCE::Evaluate(board); if (bestScore>= beta) { return bestScore; @@ -181,7 +181,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) { if (depth <= 0) return Quiescence(board, alpha, beta, ply); - const int staticEval = Evaluate(board); + const int staticEval = HCE::Evaluate(board); if (board.InCheck(board.sideToMove)) { depth++;