Exemple #1
0
#
# Copyright (c) 2018 Tommi Roenty   http://www.tommironty.fi/
# Licensed under The GNU Lesser General Public License, version 2.1:
#     http://opensource.org/licenses/LGPL-2.1
#

#---
# Excerpted from "Mazes for Programmers",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit http://www.pragmaticprogrammer.com/titles/jbmaze for more book information.
#---
import grid
import recursive_backtracker

grid = Grid(20, 20)
RecursiveBacktracker.recursively_on(grid)

filename = "recursive_backtracker.png"
grid.saveImg(filename)
ln = "saved image to %s" % filename
print ln
def save(grid, filename):
    grid.saveImg(filename)
    ln = "saved to %s" % filename
    print ln