Added minimax bot instead of random bot
This commit is contained in:
+1
-1
@@ -510,7 +510,7 @@ function handleBotMove(s: State, ctx: Ctx) {
|
||||
const seatBefore = s.turn;
|
||||
const botMove = decideBot(s, s.turn, ctx.rng);
|
||||
if (botMove !== null && typeof botMove.fromIdx === "number" && typeof botMove.toIdx === "number") {
|
||||
applyMove(s, botMove.fromIdx, botMove.toIdx, seatBefore);
|
||||
applyMove(s, botMove.fromIdx, botMove.toIdx, seatBefore, botMove.promotion);
|
||||
return postMove(s, ctx, seatBefore);
|
||||
}
|
||||
// Bot has no legal move: mated if in check, otherwise stalemate draw.
|
||||
|
||||
Reference in New Issue
Block a user