diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-04-22 11:29:25 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-04-22 11:29:25 +0200 |
commit | 12c7960189eb6a61616eb266941533fb55e8c1d6 (patch) | |
tree | 642c02f27531ef401b5e8d31bacb6ed5e522dc52 | |
parent | 98e79b09894b63d38d6bd39f97ca4df09e50b765 (diff) |
Add bang to geerate
-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))] |