Jun-24-2022, 03:18 AM
Nearly all sudoku solvers work the same way.
Try yo put a number in the first open box.
If successful move on to the next open box. If not, undo the last box and try a different number.
It annoys me that sudoku solvers arrange values in rows and columns. The puzzle is drawn that way, but storing values in a 2D array just makes the code more complicared. It is easier if the puzzle is flattened out into an 81 element 1D list.
Try yo put a number in the first open box.
If successful move on to the next open box. If not, undo the last box and try a different number.
It annoys me that sudoku solvers arrange values in rows and columns. The puzzle is drawn that way, but storing values in a 2D array just makes the code more complicared. It is easier if the puzzle is flattened out into an 81 element 1D list.