aboutsummaryrefslogtreecommitdiff
path: root/src/bot.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-31 10:07:01 +0200
committerAdam <adammegarules1@gmail.com>2026-07-31 10:07:01 +0200
commit17f245ac325cea859fb39799a9c8b088fc933808 (patch)
tree2406f5099ebe97c179e2cceb67a2b84e187e9fe5 /src/bot.cpp
parent32e11f19de1c602781f9a41fd6a3e31257860984 (diff)
improving default depth
Diffstat (limited to 'src/bot.cpp')
-rw-r--r--src/bot.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bot.cpp b/src/bot.cpp
index 61c38fa..982a4a4 100644
--- a/src/bot.cpp
+++ b/src/bot.cpp
@@ -129,7 +129,6 @@ std::vector<Move> GetSortedLegalMoves(Game *g, bool generateQuietMoves) {
}
Move EngineGetBestMove(Game *b, const int depth) {
- const int usedDepth = (depth != -1 ? depth : DEFAULT_DEPTH);
const auto moves = GetSortedLegalMoves(b);
if (moves.empty()) {
std::cout << "Expected a position with legal moves";
@@ -145,7 +144,8 @@ Move EngineGetBestMove(Game *b, const int depth) {
const float alpha = -INFINITY;
const float beta = INFINITY;
- const int eval = minimax(usedDepth - 1, b, alpha, beta);
+ const int eval =
+ minimax(depth <= 0 ? DEFAULT_DEPTH : depth, b, alpha, beta);
UnMakeMove(undo, b);
if (b->turn) {