Tic Tac Toe
Against the computer or a friend on the same device. The computer is beatable, on purpose — an unbeatable opponent is a solved game, and a solved game is not a game.
0
Won
0
Lost
0
Drawn
The record is kept against the computer only, and it is stored in this browser. It is not sent anywhere, and two-player games do not change it.
What this tool does
Two modes: one player against the computer, or two players passing one device. In the computer mode you are X and you move first. The record underneath the board tracks wins, losses and draws against the computer only — a two-player game never touches it, because a tally of games where you played both sides would not mean anything.
The computer is deliberately beatable. It plays a fixed priority list — win if it can, block you if it must, then take the centre, then a corner, then a side — with a random choice inside each tier. A perfect opponent would be trivial to write and useless to play: anybody who has played tic tac toe knows the correct reply to every opening, so an unbeatable version would be a coin that always lands on its edge. This one will lose to a player who is paying attention, which is the point. Switching mode starts a new game, and the record stays where it is.
How to use it
- Choose Computer or Two players from the opponent selector. Switching starts a fresh board and leaves the record alone.
- Click any empty square. In computer mode you are X and you always move first; in two-player mode X and O alternate on the same device.
- The line above the board tells you whose turn it is, and the line under it names the result once the game ends.
- Press New game to clear the board. Press Clear record to reset the running tally — the two are separate, so starting again never wipes your record by accident.
Common use cases
-
A quick game against the computer
Games last under a minute, and the computer will lose if you take a corner and then the opposite corner.
-
Two people, one phone
Two-player mode needs no setup and no second device. The board tells you whose turn it is.
-
Teaching the game to a child
Two-player mode on one screen is the easiest way to show somebody why the centre square matters.
-
Keeping score over time
The record against the computer persists in your browser, so a session can turn into a long-running tally.
Frequently asked questions
Can the computer be beaten?
Yes, and it is meant to be. It only looks one move ahead, so it will not see a trap that needs two moves to spring — take a corner, then take the opposite corner, and it has no answer. A perfect player would be easy to write but would make every game a draw, which is not worth playing.
Does the record count two-player games?
No. The record is specifically your results against the computer. In two-player mode you are playing both sides, so a win or a loss there would not mean anything, and the tally is left untouched.
Is the record shared between devices?
No. It is stored in this browser only, and it is not sent anywhere. Clearing your browsing data will clear it, and the **Clear record** button does the same thing deliberately.
Why does the computer sometimes take a side square?
It works down a priority list — win, block, centre, corner, side — and picks at random inside whichever tier it reaches. If the centre and all four corners are taken, a side is the only thing left.