Member-only story
Sudoku
A Program to Generate and Solve Sudoku Puzzles
I enjoy puzzles. One of my favorites is Sudoku.
In this project, we will generate Sudoku puzzles and provide a nice user interface for solving them. We will rate the puzzles by difficulty and allow the player to choose how tough they want the puzzle to be.
Sudoku players often use a pencil to mark up the squares with the possible numbers that can legally be in the square. This makes the hard puzzles easier to solve. Our program will have the option of doing the markup for you.
Going further, we will add two more aids. We will show the singletons (squares where only one digit is legal). For simple puzzles, this makes the solving trivial, as you just enter the singleton in that square, and doing this repeatedly opens up more singletons, until you have solved the puzzle. But for harder puzzles, we can benefit from more analysis.
For these puzzles, we have yet another aid, called smart markup. This uses some of the more common Sudoku strategies, reducing the number of markups. While this still won’t make the painful puzzles trivial, it helps a lot.
Hardcore Sudoku addicts will scoff at these aids, but for people just learning how to solve the puzzles, they can be enlightening.










