42. Toads and Frogs (PvP)
By the time Liina arrived, Johann had already recovered some of his usual boldness.
He stood beside the half-covered Logic Mill with the grave expression of a man who had just been admitted into a cathedral and was trying very hard not to ask whether the organ could play drinking songs.
„So,“ he said at last, „it follows rules. It counts. It reads the shape of things. Excellent. But can it lose?“
Mihkel looked up from the table. „Lose?“
„In a contest,“ Johann said. „Against another set of instructions. Not a sum. Not a verdict. A struggle.“
Liina removed her gloves slowly. She had heard enough to understand that Johann was not merely joking.
„A game, then,“ she said. „But one where the method must stand in your place.“
Mihkel was silent. The thought had already reached him. A calculation had one master: the question. A game had two. Each move became part answer, part provocation. A rule that seemed wise in solitude might become foolish when another mind replied.
Johann drew a strip of paper toward himself and sketched the board: toads on the left, frogs on the right, and a narrow emptiness between them.
„The toads advance only right. The frogs, only left. Step or jump. No retreat. No mercy. A very Baltic game, really.“
Liina leaned over the strip. „Not no mercy,“ she said. „No undoing. That is different.“
They each began to write instructions.
Johann wrote quickly, with flourishes, trusting traps and bold jumps. Liina wrote fewer lines, pausing often, as though each command must answer not only the present board but the silence after it. Mihkel wrote and crossed out, wrote again, feeling for the first time that the Logic Mill was not being asked to reveal a truth already hidden in the input.
It was being asked to choose.
Near midnight, the three instruction sets lay beside the machine. Three minds, flattened into rules. The Mill waited beneath the lamp, patient and impartial.
In this quest, you write a strategy for Toads and Frogs game and compete against other players' strategies.
The starting board is: [tttt____ffff]
You are always the toads (t), your opponent is always the frogs (f),
empty squares are _, and [/] mark the board boundaries.
There are 4 toads, 4 empty squares, and 4 frogs.
On your turn, one of your t pieces must move right into a neighboring empty square,
or jump right over one f piece into an empty square. Output the whole next board.
The boundaries must stay in place.
Example input: [tttt____ffff].
The only legal move is [ttt_t___ffff].
Another example input: [ttt__tf__fff].
There are several legal moves. One of them is to jump over a frog: [ttt___ft_fff].
After your move, the game code flips the board into your opponent's point of view and runs their solution. If a player outputs an illegal board, makes no move, or has no legal move on their turn, that player loses.
Your solution is played against other players' solutions. For every pair of players, two games are played: one with each player starting. The leaderboard shows the total number of lost games across all games.