Added minimax bot instead of random bot

This commit is contained in:
2026-10-15 11:58:38 +03:30
parent 79eda0da45
commit d8adef472e
2 changed files with 484 additions and 17 deletions
+1 -1
View File
@@ -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.