The Rules of Hex

Adapated from here and here

Hex is an abstract board game invented by the Scandinavian mathematician Piet Hein around 1940. The rules are stunningly simple and can be learned in less than a minute.

Hex is played on a board made up of hexagons. The board itself is shaped like a rhomb. Stones are placed in the hexagons. The championship sized board has eleven fields on each side of the rhomb, and is the common size for experienced players, but the game can be played on any size board. Hex boards that are smaller than 11 x 11 have been mathematically completed and are trivial for modern computers to dominate.

One player is playing with the red stones, the other with the blue stones. Both players in turn put one of their stones on a empty field on the board. The goal is to make a chain with your stones between opposite sides of the board of your colour. The red player tries to make a chain between the top and bottom sides of the board, whereas the blue player tries to complete a chain between the left and right sides. The chain doesn’t have to be a straight line as long as it is closed, i.e. it forms a complete and unbroken line from one of the player's edges to the other.

Hex can never be a draw. Either red or blue will make a chain. If the red stones form a chain between the sides on the horizontal edges, then the blue stones can no longer form a chain between the sides on the vertical edges, and vice versa. Thus, trying to make a chain is the same as preventing a chain of the enemy; the best defence equals the best attack.

Swap 'Pie' Rule

The swap rule states that after red plays the first move, blue decides whether to swap colours or not. If blue swaps colours, blue becomes red and red becomes blue. Whichever player ends up being blue makes the second move and then the game continues as usual.

When playing Hex without the swap rule, the first player has a considerable advantage. The swap rule was devised to make the game more even. Namely, if the first player plays a move that is too strong, the second player will swap and be in a strong position. And if the first player plays a move that is too weak, the second player will not swap (and therefore also be in a strong position). Therefore, the swap rule creates an incentive for the first player to play a move that is as fair as possible.

The swap rule is sometimes also called the "pie rule", since it resembles the well-known "you cut, I choose" method for fairly dividing a pie between two people. Namely, one person cuts the pie in two, and the other person chooses which piece to eat. Here, the incentive for the first person is to make the two pieces as equal as possible.

Since each opening move is theoretically either winning or losing, there exists no opening move that is exactly fair. For this reason, the second player theoretically has a forced win when playing with the swap rule. However, the second player's advantage is very small, and certainly much smaller than the first player's advantage would be when playing without the swap rule.