Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sbj42/maze-generator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sbj42/maze-generator - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

.eslintrc.json

21

package.json
{
"name": "@sbj42/maze-generator",
"version": "1.0.0",
"description": "A simple maze generator",
"main": "src/maze-generator",
"version": "2.0.0",
"description": "An infrastructure for generating mazes",
"main": "src",
"scripts": {
"demo": "node demo/demo",
"test": "mocha test/test.js"
"lint": "eslint .",
"test": "mocha && npm run lint"
},

@@ -15,3 +15,7 @@ "repository": {

"keywords": [
"maze"
"maze-generator",
"maze",
"dungeon",
"labyrinth",
"procedural"
],

@@ -24,5 +28,10 @@ "author": "James Clark <jameswclark@gmail.com> (http://arbitraryclark.blogspot.com/)",

"homepage": "https://github.com/sbj42/maze-generator#readme",
"dependencies": {
"@sbj42/maze-generator-support": "^0.1.0"
},
"devDependencies": {
"eslint": "^3.7.1",
"mocha": "^3.1.0",
"random-js": "^1.0.8"
}
}
# maze-generator
A javascript maze generator
This module generates a maze using "recursive backtracking". Usage:
This library can be used to generate mazes using various algorithms.
Installation:
```
npm install --save-dev @sbj42/maze-generator
```
Don't forget to also choose a maze algorithm and install the plugin for that:
```
npm install --save-dev @sbj42/maze-generator-backtrack
```
Usage:
```
var mazeGen = require('@sbj42/maze-generator');
// generate a 20x20 maze
var maze = mazeGen.generate(20, 20);
var maze = mazeGen.generate(20, 20, {
generator: '@sbj42/maze-generator-backtrack'
});

@@ -15,3 +32,3 @@ // get the north-east corner cell of the maze

# API
## API

@@ -24,2 +41,4 @@ `generate(width, height, options)`

1 (exclusive). The default random number generator is `Math.random`.
* `options.generator`: (optional) A maze-generator plugin, as a package name The default plugin is
`@sbj42/maze-generator-backtrack` (though you'll need to make sure that's installed to use it).

@@ -38,1 +57,5 @@ `maze.width()` / `maze.height()`

is `true`, then there is a passage in that direction. `false` indicates a wall.
## Demo
For a demonstration, see the package ``@sbj42/maze-generator-demo`.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc