summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2016-07-23 01:19:31 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2016-07-23 01:19:31 +0200
commitabbae3f0c7e6c882b2ac4ecd60ec29fa3ba0ec14 (patch)
tree20ba9b91d40831e3af23f2686dc6b9bd59466810
parente1ed22231d955eedf3895adf72fd3fbbeb133376 (diff)
downloadmaze-abbae3f0c7e6c882b2ac4ecd60ec29fa3ba0ec14.tar.xz
Move image saving to sidewinder_demo
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
-rw-r--r--grid.py2
-rw-r--r--sidewinder_demo.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/grid.py b/grid.py
index 8cc442a..f1621ec 100644
--- a/grid.py
+++ b/grid.py
@@ -121,4 +121,4 @@ class Grid(object):
draw.ellipse((x2-r, y2-r, x2+r, y2+r), fill='#000000')
img = img.filter(ImageFilter.GaussianBlur(radius=0.8))
- img.save('maze.png')
+ return img
diff --git a/sidewinder_demo.py b/sidewinder_demo.py
index 3fe790f..deab643 100644
--- a/sidewinder_demo.py
+++ b/sidewinder_demo.py
@@ -3,6 +3,8 @@ from sidewinder import Sidewinder
grid = Grid(10, 10)
Sidewinder.on(grid)
-grid.to_img()
+
+img = grid.to_img()
+img.save('sidewinder-maze.png')
print(grid)