From 12c7960189eb6a61616eb266941533fb55e8c1d6 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Sun, 22 Apr 2018 11:29:25 +0200 Subject: Add bang to geerate --- main.rb | 2 +- maze_generator.rb | 2 +- 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))] -- cgit v1.1