summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.rb b/main.rb
index 4a3d52b..d275eac 100644
--- a/main.rb
+++ b/main.rb
@@ -14,6 +14,7 @@ class MazeGenerator
@stack = [Pos.new(rand(@maze.width), rand(@maze.height))]
while !@stack.empty?
+ puts @maze if ENV["DEBUG"] == "visual"
step()
end
end
@@ -28,7 +29,7 @@ class MazeGenerator
@stack.pop()
else
randomNeighbor = neighbors.sample
- print "Removing wall between ", @stack.last, " and ", randomNeighbor, "\n"
+ print "Removing wall between ", @stack.last, " and ", randomNeighbor, "\n" if ENV["DEBUG"] == "log"
@maze.set(@stack.last, randomNeighbor.dir_from(@stack.last), false)
@stack.push(randomNeighbor)