Mazemap Pathfinder
Mazemap allows you to search for the shortest path in the given 2D map(check spec/fixtures/files/maze.txt for examples)
Mazemap has built-in command line tool
So after the gem installation you can just type
bundle exec mazemap maze.txt
to execute a search
https://rubygems.org/gems/mazemap
Docs
To generate the docs you need to checkout this repo
git clone https://github.com/leafmind/mazemap.git
cd mazemap
then
bundle install
then
yard doc
Usage
Gemfile
gem 'mazemap', github: 'leafmind/mazemap'
bundle install
In your code:
Mazemap.read_and_search(filename)
Also you can use mazemap command line tool:
bundle exec mazemap maze.txt
Maze file format example
* - obstacle
(space) - free cell
A - start cell
B - finish cell
******************************************
* ****** *** *
* *** *** ****** * B *** *
* *** *** ****** *** *
* *** ***** *** *
* ********* ***** *** *
* ******* **** *** *** *
* ****** *
* *** **** ********** *
* *** *********** *
* ******* ************ *
* ******* **** *
* A **** ******
******************************************
Known issues on MAC OS X
SciRuby/nmatrix#426
Workaround
SciRuby/nmatrix#426 (comment)