PAPixelArena โ† All games

Tic-Tac-Toe

Get three in a row. Beat the CPU or play a friend.
You
0
CPU
0
Draw
0
Your turn (X)

ยฉ 2026 Pixel Arena ยท Back to all games

About Tic-Tac-Toe

Tic-Tac-Toe is the simplest strategy game in common circulation. Two players take turns placing their symbol, an X or an O, on a three-by-three grid. The first to get three of their own symbols in a row, column, or diagonal wins. If the board fills with no three-in-a-row, the game is a draw. Most adults figure out within a few games that with perfect play, the game always ends in a draw.

The grid form goes back to ancient Rome, where a similar game was scratched into stone tablets. The English name comes from a Victorian children's rhyme. The mathematics community returned to it in the twentieth century because it is the smallest non-trivial game that can be solved completely by computer search.

Pixel Arena offers two modes. Two-player mode lets you play locally with a friend, taking turns on the same device. Single-player mode pits you against a CPU opponent. The CPU has two difficulty settings. Easy makes random legal moves and is beatable by any human after one or two games. Hard runs a minimax search that considers every possible continuation. Hard never loses. The best you can do against Hard is a draw.

The reason hard is unbeatable is the small size of the game tree. The full set of all possible games is around 250 thousand, which is small enough that a search algorithm can evaluate every branch in milliseconds. There is no luck, no hidden information, and no real-time pressure, so the algorithm always has time to find the optimal response.

Controls are click any empty cell to place your mark. There is no drag, no preview, no undo. You go first as X. The CPU answers in a fraction of a second. There is no clock and no time limit per move. The match continues until someone wins, the board fills up, or you reset.

Strategy is well-studied. The standard advice for first-mover X is to play a corner. The center is symbolic but a corner gives you more potential winning lines. After a corner opening, follow up by aiming to build two threats simultaneously, a tactic called a fork. If your opponent has to block one of your three-in-a-row threats while you have a second one queued, they cannot stop both, and you win on the next move.

For O, the only way to draw against a competent X is to play the center on your first move. Any other response loses if X plays optimally. The center is the only square that participates in four winning lines, so denying it to the opponent is a structural advantage.

Most casual play is not against the optimal strategy. Against a friend, the game is more about predicting their habits than calculating perfectly. Some players reflexively defend before attacking. Some always go for the center. Once you know the pattern, you can set traps that exploit the predictable response.

The CPU on hard difficulty will not fall for traps. The match will be a draw if you play correctly and a loss if you make any mistake. That sounds boring, and after a few games against hard it usually is. Easy mode is more entertaining because the CPU will sometimes blunder into your forks, giving you a satisfying win.

The two-player mode is the most fun mode for kids and casual play. Pass the device back and forth. The board resets in one click. Most matches take under a minute. The score in the corner tallies wins and draws across the session, so a longer hangout naturally produces a small running tournament.

The implementation here uses a soft pulse animation when a player wins, highlighting the three-in-a-row that ended the match. Quality-of-life detail rather than gameplay, but it makes losing feel less ambiguous and winning feel slightly more satisfying than a static state would.