Recursive Hexadecimal Sudoku Solver


The Problem

During the spring semester of my sophomore year, one of the homework assignments I had to do was to create a hexadecimal recursive sudoku solver. Implementing recursive backtracking functions to solve a 16x16 sudoku puzzle. Starting this process the project was set up by our professor Cam Moore, who tasked us with creating a solveSudoku and legalValues functions.


The Solution

The solveSudoku function works by checking an inputted 16x16 puzzle for empty cells represented by a value of -1. Then once an empty cell is found the solveSudoku function creates a list of possible inputs from the legalValues function. The solveSudoku function will then input the value and continue to solve the next empty value until it encounters a cell with no legal value. Then, the function will backtrack to the previously solved cell and try the next possible value. Continuing to recursively do this until the puzzle is solved or if the last legal value of the first cell is used and the puzzle is decided to be not solvable.


Experience

This assignment was a great learning experience for me since before this I had barely a clue about recursive topics at all. I was able to understand what recursion is and with the help of my professor and peers learn how recursion can be implemented in scenarios such as this sudoku puzzle. While I know that my recursive skills still have a ways to go, I think that this project was a big step for me moving forward toward getting a strong understanding of more complex coding topics like recursion.