โ† All games

โญ• Tic-Tac-Toe

You are X. Tap a square. The AI never loses โ€” a draw is a win.

You0
AI0
Draws0
Your move
Advertisement

How to play Tic-Tac-Toe

You play as X and the computer plays O. Tap any empty square to place your mark, then the computer takes its turn. The first player to line up three of their marks in a row โ€” across, down, or diagonally โ€” wins the round. If all nine squares fill up with no line of three, the game is a draw.

Can you beat the AI?

Short answer: no โ€” and that's the challenge. The computer uses the minimax algorithm, which looks ahead through every possible sequence of moves and always chooses a perfect one. Against flawless play the best result available to you is a draw, so forcing that tie is the real victory. A few things that help:

About the game

Tic-Tac-Toe โ€” also known as noughts and crosses โ€” is an ancient pencil-and-paper game with relatives dating back to the Roman Empire. Mathematically it is a "solved" game: with correct play from both sides it always ends in a draw. That property is exactly what makes playing a perfect computer such a satisfying test of concentration.