Module: Mazemap

Defined in:
lib/mazemap.rb,
lib/mazemap/graph.rb,
lib/mazemap/version.rb,
lib/mazemap/pathfinder.rb

Overview

Tries to find the shortest path

Author:

  • Evgenii Shevchenko

Since:

  • 0.0.1

Defined Under Namespace

Classes: Graph, Pathfinder

Constant Summary collapse

VERSION =

Since:

  • 0.0.1

'0.0.2'

Class Method Summary collapse

Class Method Details

.read_and_search(filename) ⇒ Object

Search for a shortest paths

Examples:

Run search

>> Mazemap.read_and_search(filename)
=> [[6, 11], [7, 11], [8, 11], [9, 11], [10, 11]]

Since:

  • 0.0.1



16
17
18
19
# File 'lib/mazemap.rb', line 16

def read_and_search(filename)
  pathfinder = Pathfinder.new(filename)
  pathfinder.solution
end