Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wasswarichard/labyrinth

Shortest path in a 2 dimensional array
https://github.com/wasswarichard/labyrinth

javascript labyrinth labyrinth-route-finder typescript unit-testing webpack

Last synced: 7 days ago
JSON representation

Shortest path in a 2 dimensional array

Awesome Lists containing this project

README

        

# Labyrinth

Find the shortest path from the start ("S") to the exit ("E").
Movement is allowed only in four directions: up, down, left, and right. You need to return the
length of the shortest path from "S" to "E". If no path exists, return -1.

## Testing the solution

To use the tests, you will need to install Node -- you can do this via the
[download page](http://nodejs.org/#download) or using
[Homebrew](http://mxcl.github.com/homebrew/) if you are on a Mac.

You can clone or download this repo. Once you have done so, from the root
directory of the repo, run:

```bash
npm install
npm start
```

To run the tests

```bash
npm run test
```

## Test cases snapshot

![Snapshot of test cases](/docs/testcases.png)

Thanks for your time :)