This is a sudoku desktop app made using the tkinter python library.
The user can enter their guesses and notes into each square, which may be checked. They can also view a step by step visualisation of the solution to the puzzle.
The solver keeps track of all the possible numbers for each sqaure. It then uses the rules of sudoku and the numbers given in the puzzle to reduce the possible numbers in each square. If any squares have a single possible number it fills them in and continues applying the rules.
If at any point it reaches a point where no squares have just one possible entry it will pick a square with the smallest number of possilbe entries and make a guess. If the guess turns out later to be wrong it will backtrack to the guessing point and try the other possibility. The backtracking is performing by using recursion.
Originally, I used a simpler version of the solver which didn’t store the possible numbers for each square. This was significantly slower as it needed much more guessing and backtracking and would take several seconds to find a solution. By using more memory to store a set of possible entries for each square, I was able to reduce this time to milliseconds. This exemplified the typical trade-off of between time and memory usage.
Scroll to see screenshots of the app working!