• unknown's avatar
    Added a non-recursive implementation of conjoin(), and a Knight's Tour · 31569561
    unknown yazdı
    solver.  In conjunction, they easily found a tour of a 200x200 board:
    that's 200**2 == 40,000 levels of backtracking.  Explicitly resumable
    generators allow that to be coded as easily as a recursive solver (easier,
    actually, because different levels can use level-customized algorithms
    without pain), but without blowing the stack.  Indeed, I've never written
    an exhaustive Tour solver in any language before that can handle boards so
    large ("exhaustive" == guaranteed to find a solution if one exists, as
    opposed to probabilistic heuristic approaches; of course, the age of the
    universe may be a blip in the time needed!).
    31569561
test_generators.py 37.5 KB