TacTix

TacTix is a two-player strategy game invented by Piet Hein, a poet well known for dabbling in math and science, best known for his game Hex.

TacTix is essentially a two-dimension version of Nim; players alternate moves, removing one or more tokens in a single row or column until the last one is removed. At the time of its founding, TacTix was played on a 6x6 board, but is now usually played on a 4x4 board.

The game can be played in both its misere and non-misere forms. The strategies outlined here make the non-misere variant of the game straightforward. The game is often used as a programming exercise, and many versions are available on the web as Java applets.

Game play
TacTix is played on a NxN grid of squares, where N was initially 6, but has more commonly been played as 4.

Players alternate removing pieces a selected row or column, as many contiguous pieces as desired. For instance, in a 6x6 game, a player might remove pieces one through four on the first row. They cannot remove only the first and third pieces, these are not contiguous.

Players alternate doing this until the last piece is removed. The player who takes the last piece loses in the misère play convention, or wins in the non-misère version.

Strategy
First Player If N Is Odd (non-misere): The player takes the center piece and symmetrically imitates every one of the opponent's moves.

Second Player If N Is Even (non-misere): Player copies opponent's moves symmetrically. You will eventually take the last piece and win.

Variations
The hexagonal variation of the game, played on a six by six by six board, is called TacTex. TacTix can also be played on any size NxN board. A Non Misere version of TacTix, where the player who makes the last move is the winner, is also playable.

Analysis
On the 4×4 grid originally proposed by Hein, the second player will always win with correct play (HAKMEM item #74).

If the game is instead played with the normal play convention (player who takes the last piece wins), the second player can always win by symmetrically mirroring the first player's moves. (Or on an odd × odd size grid, the first player can win by choosing the center piece and subsequently mirroring.)

Tac Tix has 65,536 reachable positions. Out of the reachable positions, 57,156 are winning, and 8,380 are losing