https://github.com/boppreh/maze
Simple maze generator in Python
https://github.com/boppreh/maze
Last synced: 3 months ago
JSON representation
Simple maze generator in Python
- Host: GitHub
- URL: https://github.com/boppreh/maze
- Owner: boppreh
- License: mit
- Created: 2014-03-24T19:45:46.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2025-03-03T13:50:30.000Z (3 months ago)
- Last Synced: 2025-03-18T11:01:52.446Z (3 months ago)
- Language: Python
- Size: 13.7 KB
- Stars: 64
- Watchers: 3
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Maze
====Simple maze generator in Python. Can be used as a library to generate and
modify mazes, or run from the command line to play as a game.When using as a game, the goal is to move `@`, using the arrow keys, to the
goal `$`.Usage:
- `python maze.py` (uses default size of 20x10)
- `python maze.py 40 15` (specify size 40x15)
- `python maze.py 20` (square maze 20x20)Example (don't worry, the lines look solid on the command line):
python maze.py 18 12
┌───┬───────────────┬───────────────────┬───────────────────┬───────────┐
│ │ │ │ │ │
│ │ ┌───┐ ╷ │ ┌───┐ ╷ ┌───┘ ┌───────┐ ╷ └───╴ ╷ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ ╵ │ │ ├───┘ │ │ │ ╵ ┌───┘ ╷ ╵ ├───────┬───┘ │
│ │ │ │ │ │ │ │ │ │ │ │
│ ┌───┘ │ ╵ ┌───┤ └───┴───────┤ ┌───┴───────┤ ╷ ╵ ╶───┤
│ │ │ │ │ │ │ │ │ │
│ └───╴ └───┬───┘ ├───┬───────╴ │ │ ╶───┐ ├───┴───┬───┐ │
│ │ │ @ │ │ │ │ │ │ │ │
├───────┬───┐ ╵ ╷ ╵ │ ┌───────┘ ├───╴ │ ╵ ╷ │ ╵ │
│ │ │ │ │ │ │ │ │ │ │
│ ╷ ╵ ├───────┘ ┌───┘ │ ╶───────┘ ┌───┴───────┤ └───────┤
│ │ │ │ │ │ │ │
│ └───┐ │ ┌───────┤ ╶───┴───────────────┤ ┌───╴ │ ╶───┐ │
│ │ │ │ │ │ │ │ │ │
├───╴ │ │ └───╴ └───────┬───┬───────╴ │ │ ╶───┴───┬───┘ │
│ │ │ │ │ │ │ │ │
│ ┌───┘ ├───────┬───┬───╴ │ │ ╶───┬───┘ └───────┐ ╵ ╷ │
│ │ │ │ │ │ │ │ $ │ │ │
│ └───┐ ╵ ╷ ╵ │ ╶───┘ ├───┐ └───┐ ╶───┐ └───┬───┤ │
│ │ │ │ │ │ │ │ │ │ │
│ ╷ └───────┴───────┴───────╴ ╵ └───┐ └───────┴───╴ │ ╵ │
│ │ │ │ │
└───┴───────────────────────────────────────┴───────────────────┴───────┘