Board & Cards3-8 min
Hex
Be first to link your own two opposite edges
How to play
- 1Choose your opponent, the board size, the level and your colour, then press Start. Orange always moves first.
- 2Tap an empty hexagon to place your stone there. The coloured bands outside the board show which edges each side has to join.
- 3Cells that share an edge count as joined. A cell has up to six neighbours.
- 4Be first to link your own two opposite edges and you win. The winning chain is outlined on the board.
- 5With the swap rule on, the second player gets a button after the opening move. Swapping makes that stone yours, mirrored across the diagonal.
- 6Made a mistake? Use Undo. It is once per game, and against the computer its reply is taken back with your move.
Controls
- Click / tap
- Place a stone in that cell
- Arrow keys
- Move between cells (after tapping the board once or tabbing into it)
- Enter / Space
- Place a stone in the selected cell
- Undo button
- Take back one move (once per game)
Tips
- The centre is close to all four edges, which makes it the strongest opening cell. Moving first is a real advantage, so play white sometimes if you want to improve.
- Two stones with two empty cells between them, both of which neighbour both stones, form a bridge. Block one and you answer in the other, so stride forward in bridges rather than laying stones side by side.
- Blocking right in front of an opponent's chain is easy to walk around. Cutting the route off one or two cells ahead works far better.
- A stone on the second row is effectively bridged to the edge behind it: block one cell and you reach the edge through the next.
- The hard computer defends a threatened bridge immediately and never misses a win on the board, yours or its own. Build threats in two places at once so that one move cannot answer both.
- The result card says how many cells your chain was short. Cut off means the route was severed outright; one or two cells means a single bridge could have turned the game.
What is Hex?
Hex is played on hexagonal cells laid out in a rhombus, two players placing one stone each turn. Orange owns the top and bottom edges, white the left and right. Join your own two edges with an unbroken chain of neighbouring stones and you win. A stone, once placed, never moves and is never captured.
That is the whole rulebook, and yet a full board can never end without a winner. Any wall that completely blocks your opponent is itself a chain joining your own two edges, so blocking and connecting are always the same move. What separates players is how well they use shapes like the bridge, a pair of stones one cell apart with two cells in common.
Piet Hein devised the game in Denmark in 1942 and John Nash arrived at it independently in the United States in 1948. The computer here does not play out random games. It groups your stones with a union-find structure and counts the empty cells still needed to join your two edges, counting a bridge as zero - block one of its two cells and the other remains, so the link is as good as made. The difference between your remaining distance and your opponent's is how it judges a position, and it searches from there.
Frequently asked questions
Can a game of hex really never be drawn?
No, it cannot. When the board is full one of the two players must have joined their own edges, because any wall that fully blocks the opponent is itself a chain running between your two edges. That is why there is no draw column in the record here.
Does the first player always win?
In theory yes: it is proved that the first player wins with perfect play. The actual winning method is only known for small boards, though, so on something like 11x11 both people and programs make mistakes. The swap rule is the device tournaments use to take the edge off that advantage.
What is the swap rule?
After the first player places the opening stone, the second player may take that stone as their own instead of answering it. Open in a strong cell like the centre and it simply gets taken from you; open in a weak one and nobody swaps. So the first player has to find a move that is neither too good nor too bad, and most of the first-move advantage disappears. The computer, playing second, keeps the position when the opening stone sits on its own edge row and swaps otherwise.
Which board size should I pick?
7x7 ends in a few minutes and is the best place to learn the rules and the bridge shapes. 9x9 balances reading moves against building routes, and 11x11 is the size most often used, where the long-range planning really comes in. The win streak is kept per level, whatever size you played on.
How do the levels differ?
Easy only takes a win that is already on the board and plays at random four times in ten. Normal blocks what must be blocked, defends bridges, reads two plies ahead and sometimes settles for the second-best cell. Hard spends up to 0.9 seconds a move, keeps fourteen candidate cells and deepens its search to six plies. In self-play, hard beats easy in all twenty games on both 7x7 and 9x9.
Where are my records kept?
Wins and losses per level, your current streak and your longest streak live in this browser only. Walking out of a game against the computer is recorded as a resignation loss. Clearing your browser data clears all of it.