Coming Soon
Game play area will be implemented here
Minimax with Alpha-Beta Pruning explores the game tree up to depth 6. Heuristic evaluation scores 4-cell windows. Center column and move ordering improve pruning.
function minimax(board, depth, alpha, beta, isMax) {
validCols.sort((a,b) => Math.abs(a-3) - Math.abs(b-3));
for (const col of validCols) {
dropDisc(newBoard, col, 2);
const result = minimax(newBoard, depth-1, alpha, beta, false);
if (result.score > best.score) best = { score: result.score, col };
alpha = Math.max(alpha, best.score);
if (beta <= alpha) break;
}
return best;
}