Class: MazeMagic::Generate
- Inherits:
-
Object
- Object
- MazeMagic::Generate
- Defined in:
- lib/maze_magic/generate.rb
Instance Attribute Summary collapse
- #algorithm ⇒ Object
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#maze ⇒ Object
readonly
Returns the value of attribute maze.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #generate_maze ⇒ Object
-
#initialize(height:, width:, **options) ⇒ Generate
constructor
A new instance of Generate.
Constructor Details
#initialize(height:, width:, **options) ⇒ Generate
Returns a new instance of Generate.
6 7 8 9 10 |
# File 'lib/maze_magic/generate.rb', line 6 def initialize(height:, width:, **) @height = height @width = width @options = end |
Instance Attribute Details
#algorithm ⇒ Object
18 19 20 |
# File 'lib/maze_magic/generate.rb', line 18 def algorithm @algorithm ||= MazeMagic::MazeGenerator::RecursiveBacktracking end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'lib/maze_magic/generate.rb', line 3 def height @height end |
#maze ⇒ Object (readonly)
Returns the value of attribute maze.
3 4 5 |
# File 'lib/maze_magic/generate.rb', line 3 def maze @maze end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/maze_magic/generate.rb', line 3 def @options end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'lib/maze_magic/generate.rb', line 3 def width @width end |
Instance Method Details
#generate_maze ⇒ Object
12 13 14 15 16 |
# File 'lib/maze_magic/generate.rb', line 12 def generate_maze initialize_instructions_grid generate_maze_cells_from_instructions maze end |