Hex

Hex - Connect Your Sides

Red wins:0Blue wins:0
Red to move (top-bottom)

How to play: Click any empty hex to place your stone. Red connects the top edge to the bottom edge. Blue connects the left edge to the right edge. First to connect their two edges wins. There can be no draws in Hex - one player must win.

About Hex

Hex is a pure connection game invented twice independently — by Danish poet/mathematician Piet Hein in 1942 and by mathematician John Nash at Princeton in 1948. The rules are absurdly simple: place a stone, connect your two opposite edges before your opponent connects theirs. Despite the simplicity, Hex is one of the deepest abstract strategy games ever designed. There are no draws — once the board is full, exactly one player has won.

Our online version uses an 11×11 board with three AI levels and 2-player local mode. The Hard AI uses a shortest-path heuristic over a virtual-distance metric, looking for moves that reduce its own connection while extending the opponent’s.

How to Play Hex

  1. Red moves first. Click any empty hexagon to place your stone.
  2. Players alternate. Each turn places exactly one stone.
  3. Red wins by connecting any stone touching the top edge to any stone touching the bottom edge through a chain of adjacent red stones.
  4. Blue wins by connecting left edge to right edge through a chain of adjacent blue stones.
  5. Adjacent means sharing a hex side (each hex has up to 6 neighbors).
  6. No draws are possible — every full board has exactly one winner.

Strategy Tips

  • Bridges are gold. Two of your stones placed two hexes apart with a single empty hex on each side form an unbreakable bridge — you can always counter-play to connect them.
  • Edge templates. Certain edge shapes guarantee a connection to the edge regardless of opponent moves. Memorize the basic 2nd-row and 3rd-row templates.
  • Block + extend. The best moves do both: block the opponent’s path AND extend yours.
  • Center first, edges later. Center has more directions; secure it before stretching to edges.
  • Pie rule. Some Hex implementations let the second player swap colors after Red’s first move, balancing first-move advantage. We don’t use it, so play conservatively as Red.
  • Count virtual connections. Strong play counts how many MOVES it would take you and your opponent to win — always race the closer one.

A Brief History

Piet Hein invented Hex in 1942 in Denmark and it was sold as Polygon. John Nash independently rediscovered it at Princeton in 1948 (sometimes called Nash). Nash proved by strategy-stealing that the first player has a winning strategy on any size board, but the strategy is unknown for boards 9×9 and larger — too complex to compute. Hex has been studied extensively in mathematics, AI, and economics.

Frequently Asked Questions

Why can’t there be a draw?

It’s a theorem: if the board is full, exactly one player has formed a connecting chain. This was proven topologically. Try it — you’ll never finish a game without a winner.

Does Red always win?

In theory yes — the first player has a winning strategy on any board size, proven by strategy-stealing. In practice, perfect play has only been computed for boards up to 9×9. On 11×11 (our size), the strategy is unknown so games are competitive.

What’s the pie rule?

An optional balancing rule — after Red’s first move, Blue can choose to swap colors. This discourages Red from playing too strong an opening. We don’t use it; play any opening.

How does the AI work?

It computes a shortest-path metric for both players (treating empty hexes as cost 1, your stones as 0, opponent stones as impassable). Hard AI picks moves that maximize the difference (their path much longer than yours).

What’s a bridge?

Two of your stones two hexes apart with two empty hexes between them in a specific pattern. The opponent can only block one of the two empty hexes; you take the other. Bridges effectively act as connected.

How is Hex different from Connect 4 or Gomoku?

Connect 4 and Gomoku reward making lines. Hex rewards making a connected path — any shape, just from one edge to the other. The strategic feel is more like spreading and blocking than building.

Can I play on mobile?

Yes. Tap any empty hex to place. The board scales to your screen.

What size board is standard?

11×11 is the international standard for tournaments. We use 11×11.


Skip to Accessibility Panel