diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-29 19:55:22 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-29 19:55:22 +0200 |
| commit | 4aac933e3c08535501558448ce43ce610b5e317f (patch) | |
| tree | bfcf207dd7787d70e94017ed45f1af7e32106ade /src/bot.cpp | |
| parent | 1e57de844a1524b776167ccd7a1e822677d62527 (diff) | |
adding depth support
Diffstat (limited to 'src/bot.cpp')
| -rw-r--r-- | src/bot.cpp | 6 |
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) { |
