Following from my previous post I’ve explored with an algorithm to create Sudokus by iterating from an empty grid by adding valid numbers to random cells and then invoking the solving function twice, once navigating the solution space from 1 to 9 and the other in reverse. If both solving functions return the same, valid, grid then that’s the solution.
from pprint import pprintfrom math import floorfrom copy import deepcopyfrom itertools import chain from random import shuffledef solve(sr...
Published on January 08, 2025 15:47