3 ms·
It was a long time ago, but I think I randomly filled in numbers, save if numbers were already used in each row or column, then when it reached an impossible so
by SubiculumCode 6y ago
It was a long time ago, but I think I randomly filled in numbers, save if numbers were already used in each row or column, then when it reached an impossible solution, it would work backwards one level, trying new numbers. If it ran out of numbers, it would go back two columns, and try a new number.
I doubt it was anything fancy. At the time, it bent my mind into knots. Programming is a wonderful mind trainer.
- helsinkiandrew 6y agoFor those who want to see how a backtracking algorithm would work. Computerphile walked through a python approach (11 lines) a few months ago: https://www.youtube.com/watch?v=G_UYXzGuqvM https://www.youtube.com/watch?v=G_UYXzGuqvM
- SubiculumCode 6y agoThat brought back some memories...that was pretty much what I did.