How to play
Tap a square to place X. Get three in a row before the CPU.
About Tic Tac Toe vs CPU
Tic Tac Toe vs CPU is noughts and crosses against the computer. You are X, the computer is O, and you always go first. Get three of your marks in a line, across, down or diagonally, before it does. Everybody knows the rules. The interesting part is finding out whether you can actually win.
How to play
Tap or click any empty square to place an X. The computer answers straight away with an O, and the two of you take turns until someone makes a line of three or all nine squares are full. The game tells you whether you won, lost or drew, and one more tap clears the board for another round.
There are only eight winning lines: three rows, three columns and two diagonals. A whole game lasts nine moves at most, which means a round is over in well under a minute.
What the computer is thinking
This opponent is not a pushover. It follows a clear set of priorities on every turn. If it can complete a line of three, it does. If you are one move from completing a line, it blocks you. If neither applies, it takes the centre square when that is free. Otherwise, it picks an empty square at random.
Two things follow from that. You will never win by simply lining up two and hoping it does not notice, because it always notices. And you will lose immediately if you leave it a winning square, because it always takes it.
So how do you win?
With a fork. A fork is a move that creates two separate threats at once. The computer can only block one of them, and you complete the other on your next turn.
The centre is the strongest square on the board, since it sits on four of the eight lines. Take it first. Now the computer has no centre to grab, nothing to block and nothing to win, so its reply is random.
If it replies on an edge square, the middle of a side, you can force a win. Take a corner next to its O. That gives you two in a diagonal, so the computer has to block the opposite corner. Now look for the square that completes two lines of two at the same time. Play it, and the computer is facing two threats with only one move to answer them.
If it replies in a corner instead, a win cannot be forced. Keep making threats that must be blocked and wait for a later random move to go astray. If none does, the game ends level.
Draws are normal
Between two players who make no mistakes, noughts and crosses always ends in a draw. So do not be discouraged by a string of them. Against this computer, a draw means you defended properly and it happened to find the right squares. A win means you set a trap and it walked in.
Good for learning to think ahead
For children, this is a gentle first lesson in strategy: look at what your opponent wants, not only at what you want. For adults, it is a two-minute puzzle with a clear answer. Either way, working out the fork for yourself is more fun than being told.
The game plays in your browser on any phone, tablet or computer. It is free, and there is nothing to install.