A Sudoku hint that teaches
Most Sudoku apps treat Hint as a cheat code: pick an empty cell, write the solution, move on. I wanted the opposite. If you tap Hint in Sudoku Isle, you should leave knowing why that digit belongs there.
That constraint shaped the whole engine.
An Apply button is a contract
The hint UI has one action: Apply 7. That only makes sense if a technique has already determined both a cell and a number.
Plenty of famous techniques don’t do that. An X-Wing, a naked pair, a pointing triple: they eliminate candidates. After they fire, you still don’t know what to write. Driving those from an Apply button would mean inventing a number the technique never produced.
So the hint finder only runs placement strategies, in order:
let strategies = [
("nakedSingle", { findNakedSingleHint(grid, layout) }),
("hiddenSingle", { findHiddenSingleHint(grid, layout) }),
]
Naked Single: this cell has one candidate left. Hidden Single: this number has one legal home left in a row, column, or box.
If either fires, the dialog names the technique, highlights the cells that force it, and lists the constraints in plain language. “Row 4 already contains 1, 3, 6, 8. Column 7 already contains 2, 5, 9.” Then Apply is honest: it’s putting down a digit the board already proved.
When the easy techniques run out
Every puzzle we generate has exactly one solution, so we could always fill a cell from memory. Expert boards go past singles quickly.
We don’t pretend that’s a lesson. The fallback says so:
This position requires an advanced technique. Place 4 here, deduced from the puzzle’s unique solution.
It still picks the emptiest-looking cell (fewest remaining candidates) so the reveal feels like the next logical spot, not a random gift. I’d rather be blunt than dress up a lookup as pedagogy.
Takeaway
A hint is a UX promise: I will tell you something you could have found. Once the button can apply a number, that promise only holds for techniques that actually place one.
Sudoku Isle is on the App Store with these hints. If a technique explanation feels wrong, I’d like to hear it.