# pathfinder-maze-class

> Javascript class Pathfinder to solve a 2d maze array

Latest version **1.0.2** (published 2021-02-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install pathfinder-maze-class
pnpm add pathfinder-maze-class
yarn add pathfinder-maze-class
bun add pathfinder-maze-class
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-02-10 |
| First published | 2021-02-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | e-a-w |
| Maintainers | e-a-w |

## Links

- npm: https://www.npmjs.com/package/pathfinder-maze-class
- Repository: https://github.com/e-a-w/pathfinder-promises
- Homepage: https://github.com/e-a-w/pathfinder-promises#readme
- Issues: https://github.com/e-a-w/pathfinder-promises/issues
- npm.io page: https://npm.io/package/pathfinder-maze-class

## Recent versions

- 1.0.2 (latest) — 2021-02-10
- 1.0.1 — 2021-02-10
- 1.0.0 — 2021-02-10

## README

# Pathfinder Maze Class

Javascript class which accepts a 2d maze array and solves the path through it.

To install, run `npm install pathfinder-maze-class`

Example Usage:

        const Pathfinder = require('pathfinder-maze-class');

        const MAZE = [
          [0, 0, 0, 0, 0],
          [1, 1, 1, 0, 0],
          [0, 0, 1, 0, 0],
          [0, 1, 1, 0, 0],
          [0, 1, 0, 1, 'x'],
          [0, 1, 1, 1, 0],
        ];

        new Pathfinder(MAZE).perform();

This should output:

        we found the door at 1,0! let's go!
        We found the x! It took 11 moves to get there!

Notes:

1. Mazes must have a 'door' on the left edge. Pathfinder will start on the first valid space from the top on this edge, or tell you it can't find the door.
2. A `1` is a valid space to move.
3. An `x` ends the maze and outputs the victory message above.
4. If there is no `x` or Pathfinder has more than one `1` it could move to, it will tell you it got stuck.

---
_Source: https://npm.io/package/pathfinder-maze-class · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
