diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-04-21 22:03:57 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-04-21 22:03:57 +0200 |
commit | 836e752fee59bed9add42ebf3040e298baf2ca2e (patch) | |
tree | 75c9fd92fba2b7ebdb185b6319e807d0e79541f4 | |
parent | 69ae6ada12cd1b2e6b6e4dbf3db55ae22932d17d (diff) |
Use ENV vaibales for debugging
-rw-r--r-- | main.rb | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |