Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjirou/generate-maze-by-clustering
Generate a maze by "Clustering Method" algorithm
https://github.com/kjirou/generate-maze-by-clustering
Last synced: 12 days ago
JSON representation
Generate a maze by "Clustering Method" algorithm
- Host: GitHub
- URL: https://github.com/kjirou/generate-maze-by-clustering
- Owner: kjirou
- License: mit
- Created: 2015-04-30T14:59:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-31T07:58:33.000Z (about 3 years ago)
- Last Synced: 2024-10-07T07:58:42.910Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# generate-maze-by-clustering
[![npm version](https://badge.fury.io/js/generate-maze-by-clustering.svg)](http://badge.fury.io/js/generate-maze-by-clustering)
[![Build Status](https://travis-ci.org/kjirou/generate-maze-by-clustering.svg?branch=master)](https://travis-ci.org/kjirou/generate-maze-by-clustering)Generate a maze by "Clustering Method" algorithm
## Usage
### In Command Line
```bash
npm install -g generate-maze-by-clustering
generate-maze-by-clustering 20 10
#########################################
# # # # # # # # # # #
##### ### # # # # ### ##### # ### ### ###
# # # # # # # # # #
# # # # # ##### ### # ### # # ##### ### #
# # # # # # # # # #
# ####### ### # ### ### # ### # ### ### #
# # # # # # # # # # # # #
# # # ### # # ##### # ##### ######### # #
# # # # # # # # # # # # # #
##### # # ##### ### ### # # # ### ### ###
# # # # # # # # #
### ### ####### ######### # ### ##### ###
# # # # # # # # # #
# ### # ### ### # # ############### ### #
# # # # # # # # # # # #
# ### ##### # # ##### # # # # ### ##### #
# # # # # # #
# ######### # ##### # # ### # ### ### ###
# # # # # # # # # #
#########################################
```Usage:
```
generate-maze-by-clustering {square_width} {square_height}square_width, square_height:
They do not mean byte length.
If you set "3 2" then you will get the following size:#######
# # # #
#######
# # # #
#######In the "1 1" case:
###
# #
###
```### In JavaScript
```bash
npm install --save generate-maze-by-clustering
```
Or, you can use in browser through the [browserify](https://github.com/substack/node-browserify).```
var generateMaze = require('generate-maze-by-clustering');var maze = generateMaze([20, 10]);
console.log(maze.toText());
```## Algorithm
I referred the following site:http://apollon.issp.u-tokyo.ac.jp/~watanabe/tips/maze.html
The algorithm is named by "Clustering Method" (クラスタリング法) in this site, and many japanise sites too.
However, I don't know whether that's the right name.