Online Tic Tac Toe Game
Play tic tac toe against a second player or seeded computer, practise set openings, and use minimax hints to compare every legal move.With only nine cells, tic tac toe is small enough to solve but rich enough to teach threats, blocks, and forks. X moves first, the players alternate, and the first horizontal, vertical, or diagonal line of three wins. If all cells fill without a line, the game is a draw.
The important unit of play is not an isolated mark but the set of replies it permits. An immediate threat needs a block on the next turn. A fork creates two winning threats at once, so one ordinary block cannot answer both. Strong play therefore looks one or more turns beyond the square being selected.
| Position idea | Meaning | Usual priority |
|---|---|---|
| Winning move | Completes a line of three now | Take it |
| Block | Stops the opponent completing a line next turn | Use it when no immediate win exists |
| Fork | Creates two distinct winning threats | Create your own or prevent the opponent's |
| Drawing reply | Preserves at least a draw against best future play | Prefer it to a move that permits a forced loss |
Opening position changes the lesson. Center, corner, and edge starts have different symmetry and reply patterns. Practising the same opening repeatedly makes defensive gaps easier to spot; beginning from a blank board leaves the whole opening decision in play.
A solved position assumes optimal choices from both sides. A label such as Win or Draw describes what can be forced from the current board, not what every opponent will actually do. Against a casual or imperfect opponent, a risky move may succeed because the reply is missed, but that does not make the move theoretically safe.
Match results and the browser practice record are personal learning markers. They have no monetary value and are not an official rating.
How to Use This Tool:
Choose a match or a focused opening drill, then decide whether the tactical lens should reveal the solved value of each legal move.
- Select Computer or Second player. For computer practice, choose X to move first or O to practise replying to the opening move.
- Choose Casual, Balanced, or Perfect. When practising X, optionally pre-place the opening mark in the center, a corner, or an edge; opening drills are unavailable when practising O.
- Keep or change the Replay seed, then start. Click or tap an empty cell, or move among legal cells with the arrow keys and place with Enter or Space.
- Use Show lens to reveal Win, Draw, Risk, and Best cues. After the match, read the result for your selected practice mark and choose the same seed for repeatable computer choices or a new seed for another line.
Interpreting Results:
Win, Draw, and Risk evaluate an empty cell from the mark whose turn it is. Win means that optimal continuation can force a victory, Draw means it can preserve a draw but not force a win, and Risk means optimal opposition can force a loss after that choice.
The Best flag marks every legal cell with the highest available solved value. Several cells can be equally best. On an empty board, all nine opening cells preserve a theoretical draw, although their later tactics differ.
The terminal result is reported from the selected Practice mark, so an X win is recorded as a loss when practising O. Wins, draws, and losses are stored in the current browser and can disappear when site data is cleared.
Technical Details:
A legal board has eight possible winning lines: three rows, three columns, and two diagonals. X must have either the same number of marks as O or exactly one more. A completed board cannot have winning lines for both marks, and the winning mark must agree with the move count.
Rule Core
| Computer level | Decision rule |
|---|---|
| Casual | Takes an immediate win; blocks an immediate loss 40% of the time; otherwise chooses a seeded legal cell. |
| Balanced | Takes an immediate win, always blocks an immediate loss, then chooses an optimal move 70% of the time. Otherwise it prefers the center when open or chooses a seeded legal cell. |
| Perfect | Takes an immediate win, always blocks an immediate loss, and otherwise chooses only among optimal moves. |
Mechanism Core
Minimax explores every legal continuation until a win, loss, or draw. Terminal positions receive a value from the current player's perspective, and alternating turns choose the best result for the player moving while assuming the opponent also chooses the reply that is worst for that player.
| Solved value | Lens label | Meaning under optimal continuation |
|---|---|---|
| 1 | Win | The moving mark can force a win. |
| 0 | Draw | The moving mark can avoid defeat but cannot force a win. |
| -1 | Risk | The opponent can force a win. |
The replay seed selects among equally eligible computer moves. It does not change the solved value of a position. Same-seed reproduction also requires the same opponent level, practice mark, opening drill, and sequence of player cells.
No elapsed-time score is claimed. A match records ordered moves, the winning line or draw, the selected practice result, and deterministic run identity. The tactical lens is explanatory and can be hidden without changing any rule or computer choice.