Io.horizon.tictactoe.aix Extra Quality

when TicTacToe1.OnWin(player, positions) set LabelStatus.Text = "Player " + player + " wins!" call TicTacToe1.HighlightWinLine(positions) set ButtonAI.Enabled = false

public int minimax(Cell[] board, int depth, boolean isMaximizing, int alpha, int beta) // Evaluate terminal states if (checkWin(PLAYER_X)) return -10 + depth; if (checkWin(PLAYER_O)) return 10 - depth; if (isDraw()) return 0; if (isMaximizing) int best = -Infinity; for (each empty cell) placeMark(PLAYER_O); best = max(best, minimax(board, depth+1, false, alpha, beta)); undoMove(); alpha = max(alpha, best); if (beta <= alpha) break; io.horizon.tictactoe.aix