Home / Games / Hex

Hex

2 playersvs computer~10 minNo draws, ever
Mode
Level
Board
Swap rule
You
0
VS
Computer
0

How to play

  1. Crimson connects the top and bottom edges. Saffron connects the left and right edges. Crimson moves first.
  2. On your turn, place one stone on any empty hexagon.
  3. The first player to link their two edges with an unbroken chain of their stones wins.
  4. With the swap rule on, the second player may take over the first stone instead of making a move.

The scoreboard counts games won in this session. Hex can never end in a draw.

Zoom: when the cells are small on your screen, the first tap zooms into that area and the second tap places your stone. Turn it off with the magnifier button.

Quick answer

Hex is a connection game played on a diamond of hexagons. Each player owns two opposite edges and tries to link them with a chain of stones. Stones never move or get captured.

Hex has two famous mathematical facts: it can never end in a draw, and the first player can always win with perfect play, even though nobody knows the winning strategy on a full-size board.

Rules

  1. The board is a rhombus of hexagonal cells. The standard competitive size is 11×11, and 7×7 or 9×9 boards are good for learning.
  2. One player owns the top and bottom edges, the other owns the left and right edges.
  3. Players take turns placing one stone of their colour on any empty cell.
  4. The first player to connect their two edges with a continuous chain of their own stones wins. Corner cells belong to both edges.

A game invented twice

Hex was invented independently by two people. The Danish designer and poet Piet Hein introduced it in 1942, and the mathematician John Nash rediscovered it as a student at Princeton in the late 1940s. Nash also proved that the first player must have a winning strategy.

Why Hex can never be a draw

Imagine the board completely filled. Either crimson has a chain from top to bottom, or there is no such chain. If there is none, then something is blocking every route from top to bottom, and that blocking wall is made of saffron stones that must stretch all the way from the left edge to the right edge. So exactly one player has connected, every time.

The hexagonal grid is what makes this work: hexagons that touch always share a full side, so two chains can never cross each other at a single point the way they can on a square grid. The mathematician David Gale showed in 1979 that this “no draw” property is closely related to the Brouwer fixed-point theorem from topology.

Why the first player can always win: strategy stealing

Suppose the second player had a winning strategy. Then the first player could “steal” it: place a stone anywhere, then pretend to be the second player and follow that strategy. An extra stone of your own is never a disadvantage in Hex, so the first player would win, which contradicts the assumption. Since there are no draws, the first player must be the one with the winning strategy.

The argument proves the strategy exists without saying what it is. That is why the swap rule is used in serious play: after the first move, the second player may take over that stone. The first player must then open with a move that is neither too strong nor too weak.

Strategy for beginners

1. Start near the centre

A central stone reaches toward both of your edges and gets in the way of both of your opponent’s.

2. Use bridges

Two of your stones that share two empty neighbours form a bridge. If your opponent takes one of those cells, you take the other and stay connected. Bridges let you cover distance twice as fast as placing stones side by side.

3. Block from a distance

Placing a stone directly in front of an opposing stone is easy to go around. Blocking a few cells ahead gives you more room to react.

4. Think about both directions

Every stone you place attacks and defends at the same time. The best moves extend your own chain while cutting your opponent’s.

Frequently asked questions

Can Hex end in a draw?

No. When the board is full, exactly one player has connected their edges. See why above.

Does the first player always win?

With perfect play, yes, by the strategy-stealing argument. In practice, without the swap rule the first player has a clear advantage, especially when opening in the centre.

What is the swap rule?

After the first stone, the second player may take it over instead of making a normal move. In this game the stone is mirrored across the board’s long diagonal so it points in the new owner’s direction.

How strong is the computer?

It uses Monte Carlo tree search with a technique called RAVE, which is well suited to Hex. Easy thinks for a fraction of a second, Medium for under a second and Hard for about two seconds. It plays better on smaller boards.


More: All games · Ultimate Tic-Tac-Toe · Dots and Boxes