aboutsummaryrefslogtreecommitdiff
path: root/src/bot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bot.cpp')
-rw-r--r--src/bot.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bot.cpp b/src/bot.cpp
index 4188308..916a311 100644
--- a/src/bot.cpp
+++ b/src/bot.cpp
@@ -10,8 +10,6 @@
#include <iostream>
#include <vector>
-const int SEARCH_DEPTH = 5;
-
const int PAWN_VALUE = 100;
const int KNIGHT_VALUE = 320;
const int BISHOP_VALUE = 400;
@@ -127,7 +125,7 @@ std::vector<Move> GetSortedLegalMoves(Game *g) {
return moves;
}
-Move EngineGetBestMove(Game *b) {
+Move EngineGetBestMove(Game *b, int depth) {
auto moves = GetSortedLegalMoves(b);
if (moves.size() == 0) {
std::cout << "Expected a position with legal moves";
@@ -142,7 +140,7 @@ Move EngineGetBestMove(Game *b) {
float alpha = -INFINITY;
float beta = INFINITY;
- float eval = minimax(SEARCH_DEPTH - 1, b, alpha, beta);
+ float eval = minimax(depth - 1, b, alpha, beta);
UnMakeMove(undo, b);
if (b->turn) {