Hex is a board game played on a hexagonal grid, theoretically of any size and several possible shapes, but traditionally as an 11x11 rhombus. Other popular dimensions are 13x13 and 19x19 as a result of the game's relationship to the older game of Go. According to the book A Beautiful Mind, John Nash (one of the game's inventors) advocated 14x14 as the optimal size.
Hex is an abstract strategy game that belongs to the general category of "connection" games. Other connection games include Omni, Y and Havannah. All of these games are related to the ancient Asian game of Go; Nash's version of Hex, in particular, was done as a response to Go.
Since the first player to move in Hex has a distinct advantage, the pie rule is generally implemented for fairness. This rule allows the second player to choose whether to switch positions with the first player after the first player makes the first move.
When the sides of the grid are equal, the game favors the first player. A standard non-constructive strategy-stealing argument proves that the first player has a winning strategy as follows:
There are two ways to make the game fairer. One way is to make the second player's sides closer together, playing on a parallelogram rather than a rhombus. However, using a simple pairing strategy, this has been proven to result in a win for the second player.
A fairer way is to use the pie rule, aka the swap rule, by which the second player has the option of swapping colors after the first player makes the first move, or first three moves, thus encouraging the first player to even out the game. Nowadays, in most online sites, the swap rule is the default, with the swap made after only one move. In theory the swap rule ensures that the second player has a winning strategy, but in practice the first player can choose a hex for which no winning strategy is known.
Cameron Browne wrote a book entitled Hex Strategy: Making the Right Connections, which covers Hex strategy at a greater level of detail than any preceding work. However, some Hex players feel that this book contains many factual errors and advocates questionable strategies. Another book, to be written by Jack van Rijswijck and Ryan Hayward, was put on hold soon after the publication of Hex Strategy; it was to have a more mathematical bent than the somewhat conversational tone of Browne's book.
Two (groups of) stones are safely connected if nothing can stop them from being connected even if the opponent has the next move. One example of this is the bridge. Let A, B, C and D be the hexes that make up a rhombus, with A and C being the non-touching pair. To form a bridge, a player places stones at A and C, leaving B and D empty. If the opponent places a stone at B or D, the remaining hex can be filled to join the original two stones into a single group.
Two groups of stones are said to be n-connected if you can connect them safely in n moves (or, more precisely, the number of moves you must make in order to safely connect the two groups minus the number of moves your opponent makes is n). Safely connected stones, such as adjacent stones are 0-connected. Bridges are also 0-connected. The lower n is, the better for you.
A path consists of two (or more) groups of stones and an empty-point set, which is the set of empty hexes that are required for the given connections. For example, the bridge path consists of the (one-member) group of stones at A and another (one-member) group of stones at C. The empty-point set is made up of the hexes B and D. For two paths to coexist and maintain the level of connectivity they have while independent, their empty-point sets must not contain any of the same hexes (otherwise the opponent could play there).
Two 1-connected paths can be consolidated together if the two groups of stones they start and end in are the same and their empty-point sets do not overlap.
John Nash proved that a game of Hex cannot end in a tie.
In computational complexity theory, generalized Hex has been proven to be PSPACE-complete.
Hex has been solved for all symmetrical playing grids up to and including 9x9: that is, a perfect strategy has been demonstrated for the first player to move, such that he is always able to win.
The determinacy of Hex has other mathematical consequences: it can be used to prove the two-dimensional Brouwer fixed point theorem, as David Gale showed in 1979, and the determinancy of higher-dimensional variants proves the fixed-point theorem in general.
Chameleon is described in Cameron Browne's book Connection Games: Variations on a Theme (2005) and was independently discovered by Randy Cox and Bill Taylor.