How Explainable Deduction Hints Work
Why Backtracking Solvers Make Terrible Hints
On most puzzle websites, clicking "Hint" simply peeks at the final solution array and fills in a random digit. This spoils the game and teaches you nothing: you have no idea why that number belongs there or what deduction you missed.
In contrast, Atelier Games executes a tiered logical reduction analyzer (implemented in getSudokuHint()). The engine inspects your exact current board state and attempts logical techniques in order of human difficulty:
- Scan for Naked Singles: Does any cell have 8 distinct numbers in its row, column, and box?
- Scan for Hidden Singles: Is any number confined to a single cell in a 3×3 box, row, or column?
- Scan for Pointing Pairs / Locked Candidates: Are candidate notes restricted to a straight line?
- Scan for Naked Pairs: Do two cells share identical candidate subsets?
The Three-Step Hint Architecture
Every hint delivered to the player contains three structured components defined in the ExplainableHint type:
Identifies the row, column, and 3×3 box without immediately giving away the digit.
Explains the specific elimination rule (e.g. "Row 4 already contains 1, 2, 3, 5, 6, 7, 8, and 9").
Optionally places the verified candidate or reveals candidate eliminations on demand.
Limitations: What If You Have Mistakes on the Board?
Because our hint generator evaluates your actual current grid state, an incorrectly placed number can create contradictions. Before providing a forward deduction, the engine first validates your existing numbers against the unique solution matrix. If an erroneous digit is detected, the hint flags the conflicting cell first so you can correct your premise before attempting further logic.