← Back to Quantum Tic Tac Toe

About Quantum Tic Tac Toe

This game was invented by Allan Goff in 2002.

How to Play

There are multiple versions of Quantum Tic Tac Toe floating around online with slightly different rules. This implementation follows the Math With Bad Drawings version. Full rules here. (Stolen from Math With Bad Drawings.)

Each turn, a player places her mark in two squares simultaneously — a quantum superposition. The mark exists in both squares at once, shown as a small X or O with a line connecting the two squares.

When the entanglements form a cycle, the game enters measuring mode. When a player makes a cycle, then it is the other player that gets to measure it. To resolve a cycle: click two squares that share an entanglement, and whichever square was clicked first is where the mark collapses to. The rest of the entanglement chain then resolves automatically.

Let's go through an example. Suppose squares 1-2 are entangled by X, and 2-3 are entangled by O. Now it your opponent playing as X and she entangles 1-3. This makes a cycle. Now it is your turn. If you click on 1 then 2, then since it was X entangling those two squares, and you clicked 1 first, an X will get resolved to square 1. Then the rest of the cycle resolves: the X that was entangling 1-3 can no longer resolve to square 1, so it goes to square 3. Then similarly and O goes to square 2. But suppose when you're measuring, instead of clicking 1 then 2, you clicked 2 then 1. Then the X that was entangling those two squares will get resolved to square 2, because you clicked that one first.

(Yes I know the UI is a bit clunky but at least it works and you get used to it after a while.)

If two squares are doubly linked, clicking will place the X's (they take priority over the O's). Whichever square was clicked first is where the X goes.

Once a square is measured, it shows a full-sized X or O and is locked in. Win by getting three measured marks in a row, column, or diagonal — same as regular tic tac toe. It is possible that after measuring, then both X and O have three in a row. In this case it's a tie.

Notes on the AI

I've strongly solved Quantum Tic Tac Toe. With perfect play, the game is a tie. Player X can play any opening move and still guarantee a draw.

I've cached all possible states after the first three moves, so the AI is fast at first, but then after the fourth move, it may take a while to think (hopefully no more than a few seconds), especially when playing on perfect mode.

Back to Quantum Tic Tac Toe