Python PNG Maze Generator
Project description
python-maze
Generates a PNG maze. Thanks to Orestis Zekai for the original algorithm.
Included Maze Types
Line maze
- Grid with separate wall segments
- Generates 2 PNGs -- one solved, one unsolved
- Every grid square is usable as a maze cell
- Can make more interesting maze generation by adding iterations
- Iteration is currently very simple -- it's set to maximize the length of the solved path
- Smart Mode: Turn on for generating smarter mazes, that make up more of the area
- Usage:
usage: line_maze.py [-h] [-H HEIGHT] [-W WIDTH] [-S] [-I ITERATIONS]
optional arguments:
-h, --help show this help message and exit
-H HEIGHT, --height HEIGHT
how high to make the maze
-W WIDTH, --width WIDTH
how wide to make the maze
-S, --smart optimize the maze by being smart
-I ITERATIONS, --iterations ITERATIONS
how many times to try
Multithreaded Line Maze Generator
- Generates line mazes, using smart mode
- May melt CPU's
- Defaults are:
- 50 by 50 maze
- iterated 100 times
- 10 threads
- Currently the best maze generator in this repo.
- Usage:
usage: multithreaded_maze.py [-h] [-H HEIGHT] [-W WIDTH] [-I ITERATIONS] [-T THREADS]
optional arguments:
-h, --help show this help message and exit
-H HEIGHT, --height HEIGHT
how high to make the maze
-W WIDTH, --width WIDTH
how wide to make the maze
-I ITERATIONS, --iterations ITERATIONS
how many times to try
-T THREADS, --threads THREADS
how many threads to spawn
Line Maze Example:
Line Maze Example:
Square maze
- Kept for historical purposes only. Don't use this. It probably doesn't even work.
- Grid
- Solving/Optimization isn't working yet
- Uses grid squares for walls
- Usage:
python square_maze.py <maze_height> <maze_width>
Fair warning:
This code is horribly inefficient, and large mazes take quite a long time to generate, especially if they are run through many iterations
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python_maze_generator-1.0.2.tar.gz
.
File metadata
- Download URL: python_maze_generator-1.0.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b00f5ce5ded8aa458d0733e959322de8c390721927e39f08965c5b2a38005514 |
|
MD5 | b60dd9efb47116680110126df502ec57 |
|
BLAKE2b-256 | b43253e40ef11b6dd8e72e9742f08bd59a42ccd8324a43c58abf0103ae80d7e5 |
File details
Details for the file python_maze_generator-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: python_maze_generator-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f321105892b28bb59e6ea60138b833e77fee04cd42f144abc65b447d9690fd4 |
|
MD5 | 69a4f7020a5854af5f6292931a3909c5 |
|
BLAKE2b-256 | d5b125bd9d85d7cb25ab042c4e6b2b3c77954a0191631fb2c9249f2f54f80352 |