summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-04-22 11:29:25 +0200
committerNoah Loomans <noahloomans@gmail.com>2018-04-22 11:29:25 +0200
commit12c7960189eb6a61616eb266941533fb55e8c1d6 (patch)
tree642c02f27531ef401b5e8d31bacb6ed5e522dc52
parent98e79b09894b63d38d6bd39f97ca4df09e50b765 (diff)
Add bang to geerate
-rw-r--r--main.rb2
-rw-r--r--maze_generator.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/main.rb b/main.rb
index 19f8376..1d0a85c 100644
--- a/main.rb
+++ b/main.rb
@@ -1,5 +1,5 @@
require_relative 'maze_generator'
mazeGenerator = MazeGenerator.new(ARGV[0].to_i, ARGV[1].to_i)
-mazeGenerator.generate
+mazeGenerator.generate!
puts mazeGenerator.maze
diff --git a/maze_generator.rb b/maze_generator.rb
index 9797624..6a0bf7b 100644
--- a/maze_generator.rb
+++ b/maze_generator.rb
@@ -9,7 +9,7 @@ class MazeGenerator
@visitedTiles = Array.new(width) { Array.new(height) { false } }
end
- def generate()
+ def generate!()
@visitedCells = [@currentPos]
@stack = [Pos.new(rand(@maze.width), rand(@maze.height))]