A brute-force sudoku solver using what I think is backtracking... It's backtracking I promise.
Sudoku is a 9-by-9 game where you get a grid with partially filled numbers and your goal is to fill them such that there are no duplicate numbers on the same column, row and 3-by-3 sub-grid.
Ugh Wikipedia better explains Sudoku I think.
- Look over the grid step-by-step
- If you encounter an empty slot,
- Look at the numbers in use on the slots column, row and 3-by-3 sub-grid.
- Determine what numbers between 0-9 are in neither the column, row or 3-by-3 sub-grid.
- continue
- If you find yourself in a dead end, move backwards and try a different number
- If you've exhausted all numbers on the current slot, still move back
This program is written in Zig by yours truly 😸