diff options
-rw-r--r-- | main.rb | 2 | ||||
-rw-r--r-- | maze_generator.rb | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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))] |