An open API service indexing awesome lists of open source software.

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)

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

Creative Commons License
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