Hex

The classic connection game on an 11×11 hexagon board — Red links top to bottom, Blue links left to right. No draws possible. Two players, one screen, pie rule included.

How to play Hex

Hex is one of the most elegant strategy games ever devised, invented independently by the Danish poet and scientist Piet Hein in 1942 and by the mathematician John Nash in the late 1940s. Two players race to connect opposite sides of a rhombus-shaped board made of hexagonal cells. The rules take thirty seconds to learn, yet the game is deep enough that mathematicians still study it today — and, famously, a game of Hex can never end in a draw. Play a friend on the same screen, or take on the computer at three difficulty levels and earn ranking points.

The goal

Each player owns one pair of opposite edges, marked in their colour around the board. Red must build an unbroken chain of red stones linking the TOP edge to the BOTTOM edge; Blue must link the LEFT edge to the RIGHT edge. A chain is unbroken when every stone in it touches the next one — each hexagon has up to six neighbours. The four corner cells belong to both adjacent edges, so they can serve either player.

The board

The board is an 11×11 rhombus (a slanted square) of hexagons — the size Piet Hein originally recommended and the classic tournament size. It starts completely empty. Red always places the first stone, and the coloured borders around the board remind you which pair of sides each player is trying to connect. Because the cells are hexagons, diagonal “gaps” like the ones in square-grid games do not exist: two chains can never cross each other without touching.

The rules

  • On your turn, place one stone of your colour on any empty cell — anywhere on the board. There are no placement restrictions.
  • Stones never move and are never captured. Every stone stays exactly where it was placed for the rest of the game, so the position only ever grows.
  • The first player to complete a single unbroken chain of their own stones connecting their two edges wins immediately.
  • Pie rule (optional, on by default): immediately after Red’s first stone, Blue may choose to “swap” — steal that opening move instead of playing their own.
  • There are no draws. If the board ever fills up, exactly one player has a winning connection — this is a proven mathematical theorem, not just a design choice.

The pie rule (swap)

Going first in Hex is a big advantage, so the pie rule balances the opening the same way you split a cake fairly: one player cuts, the other chooses. After Red places the very first stone, Blue may either answer normally or press “Swap”. Swapping removes Red’s stone and gives Blue an equivalent stone mirrored across the board’s long diagonal, and Red then moves again. Because Blue will steal any opening that is too strong, Red is encouraged to open with a deliberately modest move — usually near an edge or corner. The rule is a toggle in this app and is on by default; playing a normal stone declines the swap.

Why Hex can never end in a draw

Imagine the board completely full of stones. Any “wall” of red stones that completely blocks Blue from crossing left-to-right must itself run all the way from the top edge to the bottom edge — which means it is a winning red chain. In other words, the only way to stop your opponent is to complete your own connection: blocking and connecting are the same act. This is the famous Hex theorem, and it is closely related to deep results in mathematics (it is equivalent to Brouwer’s fixed-point theorem). Practically it means every game produces a winner, there is no stalling, and every defensive move you make is also quietly building your own chain.

Winning

The game ends the instant a winning chain is completed — the app highlights the whole connecting chain in green. Since stones are never removed, a game lasts at most 121 moves, and by the no-draw theorem one player is always the winner well before or exactly when the board fills.

Playing the computer (ranked)

In “Hex vs Computer” you choose your colour and a difficulty — Easy, Normal or Expert. The computer evaluates positions with the classic connection-distance method: it measures how many more stones each side needs, along the best possible route, to finish their connection. Easy plays loosely and sometimes misses your threats, so beginners can win. Normal always completes its own winning connection and blocks yours. Expert additionally looks ahead at the strongest candidate moves before choosing. Everything runs on your device, so it works offline. Beat it to earn ranking points: Easy +10, Normal +30, Expert +100 — sign in and your best results appear on the leaderboard.

The bridge — Hex’s most important tactic

Place two stones one “knight-ish” step apart so that exactly two empty cells connect them — this shape is called a bridge. The two stones are not touching yet, but they are effectively connected: if your opponent plays in one of the two linking cells, you simply play in the other. Bridges let you travel two rows with a single stone, so strong players sketch their connection as a chain of bridges first and only fill them in when the opponent intrudes. Learning to see bridges — and to attack positions where the two linking cells are NOT both empty — is the single fastest way to improve at Hex.

Strategy tips

  • The centre is gold. A central stone helps both directions of your connection and cuts across your opponent’s shortest routes — that is exactly why the pie rule exists. With the swap on, open slightly off-centre.
  • Move by bridges, not single steps. Two-cell bridge jumps build your connection twice as fast, and each bridge defends itself as long as both linking cells stay empty.
  • Defence IS offence. Because blocking and connecting are the same thing in Hex, the best moves do both at once — before defending, check whether the blocking stone also shortens your own route.
  • Beware of ladders. Pushing stone-by-stone along your opponent’s edge usually loses the race unless you already have a “ladder escape” stone waiting further along — place escape stones early.
  • Think in groups and edge connections, not single stones. A group that is safely connected to your edge (for example via a bridge to the edge’s corner cells) can be treated as part of the edge itself.

Frequently asked questions

Can a game of Hex end in a draw?

No — never. The Hex theorem proves that a full board always contains exactly one winning chain: any position that completely blocks one player is automatically a winning connection for the other. The app checks for a winner after every stone, so the game ends the moment a chain is complete.

How exactly does the swap (pie) rule work here?

It is available only to the second player (Blue), only immediately after Red’s first stone, and only once. Pressing “Swap” removes Red’s stone and places a blue stone on the mirrored cell across the long diagonal — the same move from Blue’s point of view — and Red moves again. Placing a normal stone instead declines the swap. You can switch the rule off before starting a game.

Is moving first really an advantage?

Yes. John Nash proved with his famous “strategy stealing” argument that the first player has a winning strategy on any board size — an extra stone can never hurt you in Hex. The proof does not reveal the strategy, though, and on 11×11 no human or computer plays perfectly, so in practice the pie rule is all the balancing the game needs.

How strong is the computer?

Easy adds a lot of randomness and only sometimes blocks your threats — it is meant to be beatable while you learn. Normal plays a solid connecting game: it always finishes a winning chain and blocks yours. Expert also searches a couple of moves ahead over the best candidate cells. Wins are worth 10 / 30 / 100 ranking points respectively.

Does it work offline?

Yes. Once the page has loaded, both the two-player mode and the computer opponent run entirely in your browser with no internet connection. Ranked wins earned offline upload automatically the next time you reconnect, if you are signed in.