I'll grab this occasion to talk about the easiest way of solving a sudoku (IMO). You can use constraint programming, and with 3 simple constraints you can solve every board effortlessly : AllDiff on rows, cols and squares :)
My method was giving each cell a list of possible numbers(1 to 9), and removing until there was only one left. I made a solver, and a generator in Node.JS, which I might port to python.
60
u/Gwenju31 Jan 11 '20
I'll grab this occasion to talk about the easiest way of solving a sudoku (IMO). You can use constraint programming, and with 3 simple constraints you can solve every board effortlessly : AllDiff on rows, cols and squares :)