This blog from benjamincongdon.me is really interesting.
It demonstrates how to build a Miracle Sudoku solver using Prolog, which is a logic programming language written in a declarative syntax. It’s incredible how concisely a solver for Sudoku puzzles can be written in that language!
What’s remarkable about these solvers is how they can tell you interesting facts about puzzles such as the Miracle Sudoku:
- The minimal number of hints necessary to uniquely define a solution board is 2.
- Boards with just 1 placed hint have 8 solutions, always – no matter which digit the hint is or where it’s placed.
- There are many, many valid 2-digit hints. For example, there are 2320 ways to place a
1
and a2
on the board which lead to a unique solution. Since there are only 72 unique solution boards, you’d run out of interesting solutions before you ran out of hints.