From 836e752fee59bed9add42ebf3040e298baf2ca2e Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sat, 21 Apr 2018 22:03:57 +0200 Subject: Use ENV vaibales for debugging --- main.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.1