Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vantoozz/maze
Maze Generator
https://github.com/vantoozz/maze
maze-generator
Last synced: about 2 months ago
JSON representation
Maze Generator
- Host: GitHub
- URL: https://github.com/vantoozz/maze
- Owner: vantoozz
- Created: 2022-11-09T00:02:59.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-29T01:08:02.000Z (about 2 years ago)
- Last Synced: 2023-03-12T02:03:03.659Z (almost 2 years ago)
- Topics: maze-generator
- Language: Kotlin
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Maze Generator
```shell
➜ maze
Usage: app [OPTIONS]Options:
-w, --width INT Maze width
-h, --height INT Maze height
-f, --format [ASCII|JSON] Output format
--help Show this message and exit```
#### Example run
```shell
➜ maze -w 80 -h 25
┌─┬────┬───┬────────────┬──┬─────┬────┬────┬──┬───┬──┬───────┬────────┬────┬────┐
├┐│┌─┬╴│╶─┐├╴╷┌──┬─────┐└─┐│┌───┐│╷┌─╴│┌──┐└╴╷│┌─┐└┬╴│╶┐╶─┐┌─┘┌─┐╶─┬─╴│╶┬─╴│╷╶┬╴│
│╵│╵╷└┐└─╴││╶┼┘┌╴├──┐╷╶┴─┐│││╷┌╴│╵│└┐┌┘│╷╶┴─┬┘│└┐├╴│╶┴┐└─┐││┌─┘┌┴┐╷└┐┌┴─┘┌╴│└┐└─┤
│╶┤┌┴╴├─┬─┘│╷╵┌┘┌┘┌┐│└─┐╶┘╵│└┤├─┤╶┼╴│└╴│└┐╶─┤┌┴┐││┌┴─╴│┌─┘├┘└─╴│╷│├╴│└╴┌┬┘┌┴┐├┬╴│
├┐││╶┬┘╷│┌─┘├─┤╶┘╶┘│└──┴─┬─┴┐╵│╷└─┤╶┴─┬┴┐├─┐│╵╷╵│││╶┬─┤│╶┬┘┌───┘│└┤╶┼──┘│╶┘┌┘││╷│
││└┼╴│┌┴┘├─┐├╴└──┬─┼─┐╶─┐│╷╶┴╴│├─┐│╶─┐├╴││╷│└┬┴┬┘╵├╴│╷╵└┐╵╶┤┌───┼┐│╷│╶──┴┬╴│┌┘│└┤
│└┐╵┌┤╵┌─┤╷│╵┌───┘╷╵╷└┬─┘│└─┬─┤│╷╵└──┘│╷│└┘└┐│╷╵┌─┤╶┘├─┐├┬─┘│╶─┐╵│├┘├─┐╷╶┘┌┘│╷├╴│
│╷├─┘│┌┘╷╵│├─┘┌──╴├─┼╴╵┌─┴─┐│╷│└┼─┬───┤└┴╴┌─┤│└┬┘╷├──┤╷│╵│╶┬┘┌╴│┌┘│╶┤╷└┴┐┌┘┌┘││╷│
││╵┌╴││╷├─┤│╶─┴┬──┘╷└─┐│╶┐╶┘││└┐╵╷│┌─┐│╶┬┬┘╷│└┐└╴│╵┌┐╵│└─┼╴│╶┤╶┴┤╶┼╴│├┬╴├┘╶┴─┤│││
│└┬┴┐│└┘│┌┘│╶┬┐│┌──┼─┐│└┐└┬┬┘│╷└─┤└┘╷│└┐││┌┘│╶┴──┴─┘├─┴─┐│┌┴┐└─┐└┐│╷│││╶┤┌┬─┐╵│└┤
│╷│╷└┴──┘│╶┴┐╵│╵└╴╷│╷│└┐├╴│╵╶┤├──┴─┬┘│╷╵╵││╶┤┌──┬╴┌─┤┌─╴│╵│╷└─┐├┐╵│└┘│└┐│╵│╷├─┴╴│
││╵├┐┌───┴─╴│┌┴┬──┘││└┐└┤╶┼──┤╵┌─┐╷│╶┴┴┐┌┘├┐│╵┌╴│╷│╷╵│╶─┴─┘├┬╴│╵└┬┤┌─┤╶┤╵┌┘││┌─╴│
│├─┘│╵┌──┬──┘│╷└─┐╶┘├╴├┐└┐╵┌┐└┐└╴││└─┬┐└┤╶┤│├─┘┌┤└┘└┬┴┐┌─┐┌┘│┌┴─╴│╵│╶┘╷└┬┘┌┘╵│┌─┤
││╶┐├─┤╶─┘╶──┤└┬┐└┬─┘╶┘├╴├─┘├╴│┌─┤├─╴│├╴└┐╵││╶─┘├─┬─┘╷└┤╷╵│╶┘│╶─┬┘┌┘┌─┘╷│╶┴┬┬┘├╴│
│├╴│└┐╵┌─┬───┴╴│└┐├──┬╴│╶┘┌┐│┌┘│╷│└─┐╵│┌╴└┐│├─┬╴├╴│╶─┼┐│├─┘╶─┼─┐│┌┴─┤┌─┘├─┐│╵┌┘╷│
│╵┌┴╴│╶┤╶┤┌────┴╴││┌╴│╶┼──┘│╵│╶┤│└┬╴├╴││╶┬┘│╵╷└┐│╶┴─┐││╵│┌─┬┐└┐││╵┌┐││╶─┤╷│└┐└╴││
├─┤┌─┴┐└╴││╶┬─┐╶┐││└┐└┐└─┐╷└┬┴┬┘├┐╵┌┴┬┘├─┤╶┼─┴╴│├╴╷┌┘│└─┘│╷│└╴╵│└┬┘╵│└┐┌┘│└╴├──┤│
├╴││╷╶┴─┐│└┐└╴└┐││└╴├┐├┬╴└┘╷╵╷╵┌┘└┐│╷│╶┤╷└╴│╶──┤╵┌┴┘╷├───┤│└┐┌─┼╴│╶─┴╴├┘╷├──┴┬╴││
│┌┘│└┐╶─┘└┐├─╴┌┘│├─┬┘││╵╶┬─┤┌┴┬┘╶─┘││└╴│├┬─┤┌─┐├╴│╶┬┘│╶┬┐│├┐││╷╵┌┴╴┌──┤┌┘│┌─╴│┌┘│
││┌┴╴├─┐┌─┘│┌─┤╶┼┘╷│╷│├──┤╷└┘╷│┌─┐┌┘├──┤╵│╷│╵╷│├─┴┐├─┴┐╵│╵││└┘├─┴──┘┌╴│└─┘│╶┬┘│┌┤
││└┬─┤╷├┘┌─┴┘╷│╷╵╶┤╵│╵│╶┐│├──┤├┘╷└┤╶┤╶┐└┐││├─┘│╵┌┐││╷╷├╴├─┘└──┘┌───┬┘┌┘╶──┼╴│╷│╵│
│└┐│╷╵││╶┘╶┬─┤└┴──┴┐├─┴╴││└┐╶┤│┌┴┐└┐└╴│┌┘│││┌─┤╶┘││╵│├┘┌┴───┬─╴│┌─┐│╶┴┬──╴│╶┤└┴╴│
│╷││├─┤└──┐│╷├─┬─┐╷│└┐╷┌┘│╷├╴││├╴├╴├─┐│╵┌┘│└┤╷└──┤│╶┤│┌┴╴┌─╴│┌┬┘╵╷└┼─┐└┐┌─┴┐└─┐╶┤
│└┤╵│╷└┬─┐└┤│╵╷│╷└┘├┐└┤│╶┼┘│╶┤││╷│┌┘╷└┴┐│┌┴┐│├┬─┐│└┐│╵│╷╶┤╶┬┘││┌─┴┐│╷└┐││┌┐├─┐├╴│
│╷└─┘└─┘╷└╴╵├─┘╵├──┘└╴╵├╴╵┌┘╷╵╵│└┘╵┌┴─╴└┘│╷╵╵│╵╷╵└╴│└─┴┴╴├╴╵┌┘╵└╴╷│╵│╶┘└┘│╵╵╷╵│╶┤
└┴──────┴───┴───┴──────┴──┴─┴──┴───┴─────┴┴──┴─┴───┴─────┴──┴────┴┴─┴────┴──┴─┴─┘
```#### Height is optional
```shell
➜ maze -w 10
┌┬──┬──┬──┐
││╷╷│┌┐│┌┐│
│└┤└┘╵│╵╵││
├┐├───┴─┬┘│
││╵┌─┬─┐╵╷│
│└─┘╷└┐└┬┤│
│╷╶─┴┐╵╷╵││
│├──┐└┬┴─┘│
││╶─┴┐╵┌─┬┤
│└──╴└─┘╷╵│
└───────┴─┘
```#### Output as JSON
```shell
➜ maze -w 10 -h 5 -f json
[
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1],
[1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1],
[1,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,1],
[1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1],
[1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1],
[1,0,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1],
[1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,1],
[1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1],
[1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
]
```