Class: MazeCrosser::RecursiveAlgorithmRunner
- Inherits:
-
Object
- Object
- MazeCrosser::RecursiveAlgorithmRunner
- Defined in:
- lib/maze_crosser/algorithms/recursive_algorithm_runner.rb
Overview
Class responsible for applying resursive algorithm to a maze.
recursive_algorithm = RecursiveAlgorithmRunner.new(maze)
Run the algorithm recursive_algorithm.run
Instance Method Summary collapse
-
#initialize(maze) ⇒ RecursiveAlgorithmRunner
constructor
A new instance of RecursiveAlgorithmRunner.
- #run ⇒ Object
Constructor Details
#initialize(maze) ⇒ RecursiveAlgorithmRunner
Returns a new instance of RecursiveAlgorithmRunner.
9 10 11 12 |
# File 'lib/maze_crosser/algorithms/recursive_algorithm_runner.rb', line 9 def initialize(maze) @maze = maze @path = [] end |
Instance Method Details
#run ⇒ Object
14 15 16 17 |
# File 'lib/maze_crosser/algorithms/recursive_algorithm_runner.rb', line 14 def run find_path(@maze.start) @path end |