Hex is a two-player connection game on a diamond-shaped board of hexagons. Red tries to join the top and bottom edges, Blue the left and right, and one of them always succeeds. Here you play a three-level computer or a friend on the same screen, on boards from 7×7 to the traditional 11×11.
Hex game rules: join your two sides
The board is a rhombus of hexagons with red edges at the top and bottom and blue edges on the left and right. Red moves first. On your turn, place one stone of your color on any empty hexagon. Stones never move and are never captured.
Red wins with an unbroken chain of red stones from the top edge to the bottom, and Blue by joining left and right. Two hexagons are linked when they share a side, so a chain can bend and wander as much as it likes, and a corner hexagon counts for both edges it touches. When a chain is complete, the game ends and the winning chain lights up.
Why a Hex game can never end in a draw
Hex has no draws, and that's not a house rule: a full board always has exactly one winning chain. Picture a full board and look at every red stone linked to the top edge. Either that group reaches the bottom, and Red has won, or it doesn't. If it doesn't, the blue stones along its lower border touch one another from the left edge to the right, and Blue has won.
It works because hexagons meet only along whole sides, never at a single point, so two chains can't cross. On a grid of squares, which can touch at just a corner, chains could cross or both get stuck. Piet Hein designed the game around this.
Board sizes, colors, and the swap rule
Under Board, choose 7×7 for a quick game, 9×9, the default, or 11×11, the traditional size. Against the computer, You play sets your color: Red moves first, Blue second.
Moving first is a big advantage in Hex, so serious games use the swap rule, also called the pie rule. Turn it on and, after Red's first stone, Blue may press Swap: take that stone instead of placing one. The stone turns blue and moves to its mirror image across the long diagonal, so a red stone on c2 becomes a blue stone on b3, in the same spot relative to Blue's edges. Then Red plays again, so Red gains nothing by opening too strong.
How the computer picks a hexagon
Under Opponent, play the computer, or choose 2 players to share one screen as Red and Blue. The computer fills the rest of the board at random many times and counts which empty hexagons tend to end up with the winner. The levels differ in how hard they look:
- Easy uses 40 random fill-ins a move, plays anywhere about one move in four, and doesn't block a chain one stone from winning.
- Medium takes a winning hexagon when it has one, blocks yours, and uses 400 fill-ins. With the swap rule off, it opens in the center.
- Hard does all that, mends a bridge as soon as you cut into it, uses 3,000 smarter fill-ins, then checks its 10 best moves with 400 more each.
With the swap rule on, Medium and Hard take over any first stone within 2 steps of the center on 7×7, or 3 on the bigger boards, and Easy swaps about 3 times in 10.
Hexagon names, taps, and keyboard play
Tap or click an empty hexagon to place a stone. Columns are lettered from a along the top and rows numbered down the side, so every hexagon has a name like e5, and a small dot marks the last stone played.
- Keyboard: Tab to the board, move with the arrow keys, and press Enter to place a stone. H shows a hint, U undoes, N starts a new game, and Escape closes the result card.
- Screen readers: each hexagon is read out with its name and what's on it, such as e5, empty, and every move is announced.
- Hint and Undo: a hint shows where Hard would play, or suggests a swap. Undo takes back your last move, and against the computer its reply too.
Bridges, ladders, and other habits
- Learn on 7×7, where a game takes a few minutes and mistakes are easy to see.
- Play near the middle early and leave the edges for later.
- When your opponent cuts into a bridge, answer in the other gap right away. Hard does it every time unless it has a win to take or a win to block first.
- Avoid ladders. If you push along the second row from your edge while your opponent blocks along the edge row, each stone you add stays one row short. A ladder only helps you if a stone of yours further along that row is waiting to catch it.
- Watch both ends of your opponent's chain, not just the stone they just placed.
- Turn on the swap rule against Hard and try openings at different distances from the center to see which ones it takes over.
Who wins the Hex game? Strategy stealing
Since Hex can't be drawn, one player must have a winning strategy, and it's the first player. The proof, credited to John Nash, is called strategy stealing. Suppose the second player had a winning plan. The first player could place one stone anywhere, then follow that plan as if moving second, placing a spare stone whenever the plan points at a hexagon they already hold. An extra stone never hurts in Hex, so the first player would win, which is impossible. So the first player has the winning plan.
Like the proof for Chomp, it doesn't say how to win, which is why the swap rule exists.
Piet Hein, John Nash, and Parker Brothers
The Danish mathematician and poet Piet Hein introduced the game in 1942 at the Niels Bohr Institute in Copenhagen. It first appeared in print as Polygon in the newspaper Politiken on 26 December 1942, sold on pads of 11×11 boards for pencil play.
In 1948 or 1949, John Nash, then a graduate student at Princeton, came up with the game again, independently as he always insisted, and players there called it Nash. Parker Brothers sold it as Hex from 1952, and that name stuck. Martin Gardner wrote about it in his Scientific American column in 1957.
Hex, mathematics, and computers
Hex keeps turning up in mathematics. In 1979 David Gale showed that its no-draw property is equivalent to the Brouwer fixed-point theorem, a well-known result in topology. In 1981 Stefan Reisch proved that judging an arbitrary Hex position is PSPACE-complete, which means no fast general method for it is expected to exist. Around 1950, Claude Shannon and E. F. Moore even built a Hex machine out of resistors and light bulbs.
Small boards have been solved by computer. An explicit first-player strategy for 7×7 was published in 2002, every opening on 8×8 was solved in 2009, and every opening on 9×9 in 2013. Boards from 10×10 up haven't been fully solved, so on 11×11 everyone knows Red can win, but not how.
Leaving an 11×11 game halfway
No account is needed. The page needs a connection to load. After that, Hard's thousands of random fill-ins run in your browser, and your moves and scores aren't sent to a server.
Your settings, a score for each opponent, and the stones on the board right now are kept in this browser's local storage, so an 11×11 game you leave halfway is still there when you return. Reset scores clears the scores, and the privacy policy lists the rest. For another game of placing stones, try Gomoku.