3D Tic-tac-toe
Four levels, 76 lines: think in three dimensions.
Tic-tac-toe in a 4 × 4 × 4 cube. Line up four spheres in any direction, including through the levels, and rotate the cube to see everything.
- Players
- 1 or 2 players
- Length
- 10 min
- Against the AI
- Two players on one device
15 days of full access, no account · No download

How to play
Goal
The board is a 4 × 4 × 4 cube of squares, made up of four stacked levels. Players take turns placing a sphere of their colour on a free square. The first to line up four spheres wins.
The 76 lines
- On a single level: rows, columns and diagonals (40 lines).
- Through the levels: the vertical pillars (16 lines) and the diagonals that climb from one level to the next (16 lines).
- The four space diagonals that cross the cube from corner to corner.
How it works
- Amber always goes first.
- Play by tapping a square on any of the four levels drawn flat; on a computer, you can also click directly in the cube.
- Rotate the cube by dragging it, or with the keyboard arrows.
- If all 64 squares are filled with no line, the game is a draw.
About the AI
The engine keeps track, for each of the 76 lines, of the number of spheres each player has there, which makes evaluation instantaneous. It explores moves with alpha-beta pruning and a transposition table, extends the search on forced blocks and looks for wins through successive threats: each move creates a threat that the opponent must block, up to the decisive double threat.
At the Master level, the AI also rules out any move that would hand its opponent such an attack. As a fun fact, this cube was solved by computer in 1980: the first player can force a win, but the winning strategy is fearsomely complex.
AI levels
- BeginnerSees one move ahead and gets caught out by threats.
- AmateurBlocks direct threats, but does not see traps coming.
- IntermediateLooks for forced attacks: a solid opponent.
- ExpertDeep calculation and defence against forced attacks.
- MasterDeep search, forced attacks and merciless defence.
