Tic-Tac-Toe

Place three X marks in a row before the computer places three O marks.

Loading game

Stats on this device

Your unfinished game is saved only in this browser.

Played
0
Wins
0
Win rate
Fastest win
Fewest moves
Best score
Current streak
0 days
Best streak
0 days

How to play

Place three X marks in a row before the computer places three O marks.

  • Choose any empty square to place X.
  • The computer replies with one legal O move.
  • Complete a horizontal, vertical, or diagonal line of three to win.

Strategy tips

  • Take the center when it is available.
  • Block any line where the computer already has two marks.
  • Create two possible winning lines so one remains open.

Complete guide

Rules, scoring, and strategy

Tic-Tac-Toe is the complete three-by-three line game against a deterministic browser opponent. You play X, the computer plays O, and each square can be used once.

Turns, legal squares, and lines

Select any empty square to place X. The browser then chooses one legal square for O; occupied squares never change and cannot be selected again. A horizontal row, vertical column, or either diagonal containing three identical marks ends the round immediately.

How the browser opponent responds

The opponent first completes an available winning line, then blocks an immediate X win. If neither exists it prefers the center, useful corners, and finally the remaining edges in a fixed order. The strategy is deterministic, so the same position always receives the same reply.

Create two threats instead of one

A single open pair is easy to block. Strong play places marks so two different lines could be completed on the following turn, often by combining a corner with the center. Check every row, column, and diagonal created by your move before choosing a tempting isolated square.

Keyboard play and a drawn board

Use the arrow keys to move focus around the logical grid and Enter or Space to mark the focused square. If all nine squares fill without a line, the round is a draw rather than a loss. Start a new round to clear every mark and return focus to the first square.

Questions players ask

Which mark does the player use in this version?

The player always uses X and takes the first turn; the deterministic browser opponent responds with O.

Can a completed Tic-Tac-Toe round continue?

No. As soon as either mark completes a line, or all squares fill for a draw, further placements are disabled.

Is the browser opponent another online player?

No. It is a local deterministic rules function, so no moves, board positions, or personal details are sent to another player.