Sudoku: Creating and/or Solving
- October 8, 2012
- 6 replies
- 3395 views
There are very few Sudoku solvers in the Community and the one I saw doesn't work on the harder problems. The attached file can be used to create problems in a random manner with some control on the level of difficulty. This control is provided by setting the number of cells with non-zero starting values and a lower bound on the number of cells provided in the 3x3 squares. If the user wishes, a manual starting matrix can be supplied as a problem instead of using the randomly generated problem.
The program starts with logic loops that I used to solve problems by hand. When the solution reaches the point where it appears (to me) that the problem becomes a trial and error process, then the program goes into that mode. The solution provides a printout of the number of logic outer loops and the number of trial and error guesses needed.
I created this worksheet several years ago, so even I can't understand the program now. Therefore, don't ask for explanation. It's just presented for your enjoyment. Part of that enjoyment may be figuring out how the program works. Once I got this working, I was through with Sudoku.
The program is in Mathcad 15.

