https://github.com/jamis/zing
Framework for playful maze generation (from "Twisty Little Passages" presentation at MWRC 2015)
https://github.com/jamis/zing
Last synced: 7 months ago
JSON representation
Framework for playful maze generation (from "Twisty Little Passages" presentation at MWRC 2015)
- Host: GitHub
- URL: https://github.com/jamis/zing
- Owner: jamis
- License: other
- Created: 2015-03-10T16:59:35.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-29T01:02:37.000Z (about 11 years ago)
- Last Synced: 2025-04-18T05:53:43.266Z (about 1 year ago)
- Language: Ruby
- Size: 4.37 MB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Zing!
Zing! is a framework for playful generation of random mazes.
This was taken from the "Twistly Little Passages" presentation at
Mountain West Ruby Conference 2015. The framework is strongly
influenced by the code from the author's book, "Mazes for Programmers",
published by the Pragmatic Programmers:
https://pragprog.com/book/jbmaze/mazes-for-programmers
## Usage
There are *lots and lots* of examples in the `examples` directory. The
basic usage looks something like this:
~~~ruby
require 'mazes/grid'
require 'mazes/algorithms/growing_tree'
rows, columns = 20, 30
grid = Mazes::Grid.new(rows, columns)
Mazes::Algorithms::GrowingTree.on(grid, [:last, :random])
grid.render.open
~~~
The above will generate a 20x30 grid, run the Growing Tree algorithm
with a 50/50 split between choosing the last cell and choosing a
random cell, and then render a PNG image of the resulting maze and
display it.
## Dependencies
The code is currently *very very very heavily* Mac specific. Some functionality simply will not work on anything but a Mac. Pull requests to fix these dependencies are welcome.
Other dependencies:
### Gems
* ChunkyPNG & OilyPNG (http://chunkypng.com/)
* OpenGL gem (https://rubygems.org/gems/opengl)
### Utilities
* ImageMagick (www.imagemagick.org -- for animated gifs)
* POV-Ray (http://povray.org/ -- for 3D rendering)
## License
Creative Commons Attribution-ShareAlike 4.0 International

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
## Author
Jamis Buck
If you like this code, please buy my book, too!
"Mazes for Programmers"
https://pragprog.com/book/jbmaze/mazes-for-programmers