Turning Turtles: a row of 12 coins
A row of coins, some heads and some tails. A move turns some of them over, and the rightmost coin turned must go from heads to tails — which is what makes the game end. The number under each place is what a lone head there is worth, and the row is worth the exclusive or of the places showing heads.
4 essays call
coin-row. The drawing above is what it returns with no arguments at all; every
call below passes it something, because a placement that passes nothing draws whichever
member of the family the generator happens to default to rather than the one its essay argues
about.
The positions it draws
9 distinct positions, harvested by running this generator again at the options each essay passed it.
| Position | Worth | Outcome | Drawn in |
|---|---|---|---|
heads at 1, 2, 3, 4 of 12 |
0 |
P | A row of coins is already a sum |
heads at 1, 2, 3, 4 of 8 |
0 |
P | The losing positions are a code |
heads at 2, 4, 7 of 12 |
∗8 |
N | A row of coins is already a sum |
heads at 2, 5, 8 of 8 |
∗4 |
N | The code names the move |
heads at 1, 8 of 14 |
0 |
P | A row of coins is already a sum |
heads at 6, 9, 12 of 14 |
∗7 |
N | A row of coins is already a sum |
heads at 3, 5, 6 of 12 |
0 |
P | A row of coins is already a sum |
heads at 3, 5, 8 of 12 |
∗14 |
N | The tartan theorem · A row of coins is already a sum |
heads at 8 of 12 |
∗8 |
N | A row of coins is already a sum |
Where it is called
Changing this generator changes every one of these figures.
A row of coins is already a sum
Everywhere else on this site a sum is several positions side by side. In a coin-turning game it is one row — each coin showing heads is a game in its own right, and the row is worth the exclusive or of them. The decomposition is inside a single picture.
The tartan theorem
The nimbers are a field, with a multiplication defined by a mex-style rule that looks like an algebraist's amusement. Lay two coin-turning games on a grid and the Grundy value of each square is the nimber product of its two coordinates — which is the point at which the multiplication stops being a curiosity and starts computing answers.
The losing positions are a code
Turn over one, two or three coins, and the rows a player has already lost turn out to be closed under adding two of them together. That makes them a linear code — and on eight coins it is the extended Hamming code exactly, sixteen words with a weight enumerator of 1 + 14x⁴ + x⁸, produced by a move rule that knows nothing about codes.
The code names the move
If the lost rows of a coin-turning game are a linear code, then a won row is a codeword with errors in it and the winning move is whatever turns the errors off. Over all 256 rows of Mock Turtles on eight coins: 16 codewords, 240 won rows, none more than two coins from a lost one — and 64 of them whose cheapest winning move has to turn three coins anyway.
The whole library · The position index · The figures that play back