What is Kayles?
Kayles is played on a single row of pins. On your turn you knock down either one pin or two pins that stand next to each other. The player who knocks down the last pin wins: the game is always played the normal way round, so the misère switch and the starting piles option of the standard game do not apply.
The row has 7 (small), 10 (medium, the default) or 13 (large) pins, chosen as the size in the table setup. Knocking a pin out of the middle splits the row into two shorter rows, and later moves can split them again, so a game that starts with one row soon becomes a game of several rows, played much like Nim heaps that can be broken in two.
Rule changes
| Rule | Standard Nim | Kayles |
|---|---|---|
| Board | Standard NimSeveral heaps of objects: 1, 3, 5 and 7 by default, or another set chosen in the table setup. | KaylesOne row of 7, 10 (default) or 13 pins, chosen as the size in the table setup. The gaps left by fallen pins split it into shorter rows. |
| Moves | Standard NimTake one or more objects from one heap. | KaylesKnock down one pin, or two pins standing side by side. Two pins with a gap between them are not side by side. |
| Goal | Standard NimMisère play by default: whoever takes the last object loses. The setup can switch to normal play, where taking the last object wins. | KaylesAlways normal play: whoever knocks down the last pin wins. |
| Winning play | Standard NimLeave the heaps with a nim-sum (the bitwise XOR of their sizes) of zero, with a twist in the misère endgame. | KaylesEach row of standing pins is worth a Nim heap whose size comes from a table, and you leave those values with a nim-sum of zero. From a single full row the first player always wins: knock down the middle pin or the middle two, then copy every opponent move on the other side. |
History
The English puzzle writer Henry Dudeney set Kayles as puzzle 73 of his book The Canterbury Puzzles. The name comes from the French quilles, “bowling pins”.
Richard Guy and Cedric Smith worked out the full theory of the game in a 1956 paper in the Proceedings of the Cambridge Philosophical Society, using the theory of Roland Sprague and Patrick Grundy: they computed the Nim value of every row and found that, for rows of more than about seventy pins, the values repeat with period 12. William Sibert analysed the misère version, in which knocking down the last pin loses, in 1973, but his analysis was published only in 1989.