![projects](images/title-projects.gif)
Sudoku Solver
Much like the Rubik's Cube Solver, this project was done for a computer science class with
Steph Stubler (it was even the same professor). Unlike the Rubik's Cube Solver, I did the algorithm for
this one instead of the interface.
The algorithm to do the logical parts turned out to be relatively simple. I managed to get the basic checks done in about 15 lines by storing the state of the board in multiple ways so I could access the table as a set of rows, columns, or squares, whichever I needed at the moment. The guessing part was a fun little piece of code as well. Once you run out of logical steps, it searches the board for the square with the fewest number of possible values and starts guessing at one that square might be. Each time the program guesses, it places a copy of the board on a stack for each possible value of the square being guessed at. Then, it takes a puzzle off the stack and tries to solve it. If at any point the puzzle reaches a logical fallacy, it throws out the current board and grabs the next one off the stack.
Steph made a nice little installer for this project which she hosts here. Aside from the solver, it's also a fully functional game.