Abstract strategy · Connection gameHex,
Hex,
connect your two sides.
You play red, top to bottom. The AI plays blue, left to right. Place a stone on any empty hex — first to connect their two sides wins.
- Turn
- Your turn
- Time
- 0:00
- Moves
- 0
About the gameHow Hex works,
How Hex works,
in short.
- Step 01
A rhombus of hexagons.
You play red against an AI in blue. Red wants to connect top to bottom; blue, left to right.
- Step 02
Place one stone per turn.
Tap an empty hex to place your stone. The AI responds. Blocking opponents is just as important as building.
- Step 03
First chain wins.
Form an unbroken chain of your colour across your two sides. No draws — someone always connects.
Questions
Hex questions, answered.
Hex is a two-player abstract strategy game invented independently by Piet Hein in 1942 and John Nash in 1948. It is played on a rhombus of hexagons. You take turns placing stones on empty cells. You win by forming an unbroken chain of your stones connecting your two assigned sides. There are no draws — at the end of a fully filled board, exactly one player has a winning chain.
You play red, joining the top and bottom edges. The AI plays blue, joining the left and right. Click any empty hex to place your stone, then the AI replies. Whoever first builds a chain between their two sides wins.
Players alternate; you go first. A stone may be placed on any empty hex. Once placed, a stone never moves and is never removed. Chains follow hexagonal adjacency — each hex has six neighbours. The first player to connect their two sides wins immediately; play does not continue beyond that.
Easy is 7×7 with a one-ply search — the AI sees one move ahead and picks the strongest response, but is short-sighted about your follow-ups. Medium is 9×9 with a two-ply search; Hard is 11×11 with a three-ply search, so the AI plans around your reply and its own follow-up. Larger boards reward longer-term threats and ladders; smaller boards punish tactical mistakes immediately.
Hex is a connection game, so think about threats, not just defence. A bridge — two of your stones two hexes apart with two empty intermediate cells — is an unbreakable connection because if the opponent plays one of the intermediates you simply take the other. Build bridges along the diagonal between your sides. Cut your opponent's bridges before they multiply.
There's a famous strategy-stealing argument: if the second player had a winning strategy, the first player could play a random move and then steal it (extra stones never hurt in Hex). So the first player must have a winning strategy. The proof is non-constructive — the strategy itself is computationally brutal to find, especially past 9×9.
A classic topological theorem: in a fully coloured Hex board, exactly one of the two colours has a winning chain. There is no position where both lose. This is why Hex never needs a draw rule.
The AI runs an alpha-beta minimax search. Its evaluation function treats the board as a path-distance problem: for each colour, what is the smallest number of empty cells you still need to convert to connect your two sides? Own stones cost 0, empty cells cost 1, opponent stones are blocked. The AI maximises 'your remaining distance minus mine'. A short tactical pre-pass always takes an immediate win and always blocks an immediate threat, regardless of difficulty. Search depth (1, 2, or 3 plies) scales with difficulty — deeper searches plan further into your response and the AI's follow-up.
More to play