# Rules

The Hex board is composed of hexagons, arranged in an *n×n* rhombus, where *n* is an integer greater than zero. Thus Hex can be played on boards of different sizes. Currently, 11×11, 13×13 and 19×19 are the most common board sizes. The four edges of the board are colored with two colors, in such a way that parallel edges have the same color. The board is empty at the start of the game. On the left you can see an empty Hex board.

Hex is played by two players, who take turns in placing a single piece on the board. One player will place the red pieces and the other will place the blue pieces. The player placing the red pieces wins if she builds a solid chain between the two red edges, and the player placing blue pieces wins if he builds such a chain between the blue edges. On the right you see an example of a win by the player who placed the red stones.

The above rules give a strong advantage to the first player. Because of this, the swap rule was introduced. The swap rule is also called the "pie rule", since it resembles the "You cut, I choose rule" when sharing a pie between two children.

Suppose that at the start of the game the first player has the red pieces. Then she places a red piece on the board, in any cell she likes. After that, the second player decides who will play as red and who will play as blue. Then whoever was decided to be blue makes the next move, and the game continues normally.

The game is guaranteed to end with a winner because it is impossible for one player to surround one edge of the opponent without connecting his own two edges. It's also trivial to see that having the right to move is always advantageous. The strategy page explains how to play for the win in practice.