| Step | Type | Cell |
|---|
---
Over the last couple of months (currently January 2025) I've been obsessed with Sudokus. Finding the little tricks that allow you to solve these puzzles are the most fun part for
me. This fascination led me to exploring the way that these puzzles are generated and as it turns out the key to generating Sudokus is solving Sudokus. Generation is made up of a
few basic steps:
-
Basic Steps
- Fill in a completed board adhereing to the rules of Sudoku.
- Remove values at index `X` and `80 - X`.
- Solve the board and check that there is only 1 possible solution.
- If the board is unsolvable or there are more than 1 solution, replace the values that were removed.
- Repeat steps 2-4 until all cells have been checked.
Now the magic of Sudoku generation comes in the solver, so more than anything I've created a Sudoku solver that just happens to be used for generating puzzles. My goal with this solver was to make it use "human-like" techniques as opposed to brute forcing the solution. Now my solver isn't perfect and as such needs to resort to guess and backtrack to overcome some points in solving the harder puzzles. I plan on including more solving techniques, but for now the solver uses Naked Singles, Hidden Singles, Naked Pairs, Hidden Pairs, Naked Triplets, Hidden Triplets, and Locked Candidates. As of now my solver will generate Sudokus at an easy to medium (but mostly easy) level.
This project was my first attempt to really utilize JavaScript outside of basic web page animation, so I learned quite a bit about the language. I also found the convenience of styling with HTML and CSS to be extremely useful in quickly prototyping whereas making UI in other languages like Python can involve a good bit of scaffolding.