diff options
Diffstat (limited to 'src/bot.cpp')
| -rw-r--r-- | src/bot.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/bot.cpp b/src/bot.cpp index 84949bb..f114f36 100644 --- a/src/bot.cpp +++ b/src/bot.cpp @@ -145,10 +145,8 @@ float minimax(int depth, Game *b, float alpha, float beta) { return EvaluateBoardForWhite(b, depth); } - float bestEval; + float bestEval = b->turn ? -INFINITY : INFINITY; if (b->turn) { - bestEval = -INFINITY; - for (Move move : moves) { UndoMove undo = MakeMove(move, b); @@ -164,10 +162,7 @@ float minimax(int depth, Game *b, float alpha, float beta) { } } } else { - bestEval = INFINITY; - for (Move move : moves) { - UndoMove undo = MakeMove(move, b); float eval = minimax(depth - 1, b, alpha, beta); |
