summaryrefslogtreecommitdiff
path: root/maze.rb
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-04-22 00:48:54 +0200
committerNoah Loomans <noahloomans@gmail.com>2018-04-22 00:48:54 +0200
commit70834814edf45cfe68d9bb65a21523e02c80f926 (patch)
tree66f04f8726067dc256e9af3503cfc2a5d7f9cc88 /maze.rb
parent4c7bb3b5086f3eef81d3c02716b9f10945ced585 (diff)
Make the visual debug really fancy
Diffstat (limited to 'maze.rb')
-rw-r--r--maze.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/maze.rb b/maze.rb
index d12a8f5..f3cbe1f 100644
--- a/maze.rb
+++ b/maze.rb
@@ -53,7 +53,7 @@ class Maze
end
end
- def to_s
+ def to_s(prefix='')
drawingField = Array.new(@height * 2 + 1) { " " * (@width * 2 + 1) }
@v_walls.each_index do |x|
@@ -76,6 +76,6 @@ class Maze
end
end
- drawingField.join("\n")
+ drawingField.map { |line| prefix + line }.join("\n")
end
end