Update ChessEngine.js

This commit is contained in:
Brad Stein 2018-08-30 00:30:27 -05:00 committed by GitHub
parent 5c14f1b4d0
commit 2d4f4f9544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,7 +120,12 @@ class ChessBot{
bestValue = currentValue;
}
}
return bestMove;
if (bestValue === 0) {
return this.determineSimplestBotMove(game, source, target);
} else {
return bestMove;
}
}
mini_max_AB(depth, game, alpha, beta, isMaximizingPlayer){