← All posts

Tic Tac Toe Strategy: How to Never Lose Against the Bot

8 May 2026 · 4 min read

Tic-tac-toe looks like a children's game, but it has a small, beautiful optimal strategy. Once you internalise it, you'll never lose a game again — and against most casual opponents (including weaker bots), you'll win consistently. Here's the entire playbook.

The fundamental truth

If both players play perfectly, tic-tac-toe is always a draw. That means your goal isn't to "win" — it's to never make a mistake and to punish your opponent's mistakes when they appear.

When you play first (X)

Your opening move sets up the entire game.

  • Take a corner. This is the strongest opening. It gives you two diagonals plus an edge and a column to threaten with.
  • Avoid the centre as your opener if the bot is strong — it actually limits your fork options. Against weak bots, the centre is fine.

After your opening corner, your second move depends on the bot's response:

  • If the bot takes the centre, take the opposite corner. This creates a diagonal threat that the bot is forced to block, freeing you to set up a fork.
  • If the bot takes any other square, take another corner that creates two threats at once — a classic fork.

A fork is the whole game. If you create two simultaneous winning threats, the opponent can only block one.

When you play second (O)

This is harder because X has the initiative. Your only job is to draw.

  • If X opens with a corner, take the centre. This is the only response that guarantees a draw.
  • If X opens with the centre, take a corner. Any corner works.
  • If X opens with an edge, take the centre. Then mirror their play around the centre.

From there, always block any two-in-a-row before doing anything else.

The priority order on every move

Walk through this list, in order, on every single turn:

1. Can I win this move? If yes, win.

2. Can my opponent win next move? If yes, block.

3. Can I create a fork (two threats)? If yes, do it.

4. Can my opponent create a fork? If yes, block or force a defensive move.

5. Take the centre.

6. Take the opposite corner from the opponent.

7. Take any empty corner.

8. Take any empty edge.

This list is the entire optimal algorithm. Memorise it and you will never lose.

Practising on Thinq Magic

The Thinq Magic bot uses a similar but slightly less aggressive heuristic — it always blocks and always wins when given the chance, but it doesn't always set up forks. That makes it the perfect training partner: punish its non-optimal moves with the rules above, and you'll win consistently for the daily 20-point reward.

Want to test yourself? Open the game, take a corner as X, and see how many moves it takes to win.