Heideapps
← The Workshop

The solver came first

Zuerst kam der Löser

The obvious way to make a sudoku is to fill a grid, remove numbers at random until it looks hard enough, and ship it. It works. It also produces puzzles that cannot be solved, only guessed at — and from the outside there is no way to tell which ones.

So the solver was written first. Eleven techniques, the ones people actually use at a kitchen table: naked and hidden singles, pairs and triples, pointing pairs, box-line reduction, and the three that make you feel clever — X-Wing, Y-Wing and Swordfish.

Only then the generator. It removes a number, hands the grid to the solver, and asks whether a person could still finish it. If the answer is no, the number goes back. Every puzzle in the app has been through that loop.

The cost is that generation is slow and the code is much larger than it needs to be. What it buys is one sentence you can stand behind.

No puzzle here has ever needed a guess.