Ultimate Tic Tac Toe

An ultimate tic tac toe game with a bot that runs a depth weighted minimax algorithm in each sub-game. This means the AI would play optimally to win or force a tie on a regular 3x3 board with alternating turns, but since turns in each board do not alternate in Ultimate Tic Tac Toe the AI can be beaten.

Rules: Alternating turns. One large 3x3 grid contains a smaller sub-grid in each square. To start you may choose to move in any square in any grid. Then the AI can choose a move only in the sub-grid corresponding to the location inside the sub-grid of your previous move. Once a sub-grid is won by a player that sub-game is complete and is claimed by the winning player. If a player is sent to a sub-grid that is already won then that player may move in any sub-grid. A player winning three sub-grids in a row, column, or diagonal wins the match.

For example, if your first move is in the center of the top-left grid, then the AI may move in any space in the center grid. If the AI chooses the bottom-right square in the center grid then your next move must be in the bottom-right grid. The game continues like this.

Available moves are indicated by purple highlighting.

On gameover, click any where to restart the game.