Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dong50252409/maze
Prime maze generation algorithm implemented by Erlang
https://github.com/dong50252409/maze
Last synced: about 1 month ago
JSON representation
Prime maze generation algorithm implemented by Erlang
- Host: GitHub
- URL: https://github.com/dong50252409/maze
- Owner: dong50252409
- License: apache-2.0
- Created: 2021-07-10T13:31:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-01T06:56:01.000Z (5 months ago)
- Last Synced: 2024-08-01T08:29:15.044Z (5 months ago)
- Language: Erlang
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
maze
=====多种迷宫生成算法实现的Erlang库,包含深度优先算法、回溯算法、prime算法等
额外附带一个岛屿生成算法,基于原细胞自动机算法
Build
-----$ rebar3 compile
How to use
----1> Width = 10.
10
2> Hight = 10.
10
3> dfs_maze:create_maze(Width,Hight).
{{1,0,1,1,1,1,1,0,1,1,1},
{1,0,1,0,1,0,1,0,1,0,0},
{1,0,1,0,1,0,1,0,1,1,1},
{1,0,0,0,1,0,1,0,0,0,1},
{1,1,1,1,1,0,1,1,1,0,1},
{0,0,0,0,0,0,0,0,1,0,1},
{1,1,1,1,1,1,1,0,1,1,1},
{1,0,1,0,0,0,0,0,0,0,1},
{1,0,1,0,1,1,1,1,1,0,1},
{1,0,1,0,1,0,1,0,0,0,1},
{1,0,1,1,1,0,1,1,1,1,1}}
4> util:print_maze(v(3)).
XXXXXXXXXXXXX
X X X X
X X X X X XXX
X X X X X X
X XXX X XXX X
X X X X
XXXXXXXXX X X
X X X
X X XXXXXXX X
X X X X X
X X X X XXX X
X X X X
XXXXXXXXXXXXX
ok