@sbj42/maze-generator
Advanced tools
Comparing version 1.0.0 to 2.0.0
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59
4759
1
3
43
1
1
+ Added@sbj42/maze-generator-support@0.1.0(transitive)