Hide

Problem H
Normal TacTix

Languages da en

TacTix is a strategy game for two players invented by the Danish poet, designer, and author Piet Hein (1905–1996). The game is extensively described in Martin Gardner’s book Hexaflexagons and Other Mathematical Diversions: The First Scientific American Book of Puzzles and Games, 1988.

TacTix is played with $16$ pieces on a $4\times 4$ board labeled A to P. Players take turns to remove pieces. A move consists of a player removing between $1$ and $4$ pieces; the pieces must be adjacent and belong to the same column or row.

The goal is to take the last piece. Here is a game where player $2$ (the blue player) wins by taking the last piece.

\includegraphics[width=.33\textwidth ]{1.pdf}

Write a program for player $2$ that always wins.

Interaction

The interaction begins with the move of player $1$. Then you write your move, and you take turns until someone wins. Each move consists of a single line with a legal move indicated by uppercase letters A to P, separated by spaces.

Read Sample Interaction 1 Write
C
M N O
F G
D H L P
A
E
B
I J K

Please log in to submit a solution to this problem

Log in