Skip to content
/ zing Public

Framework for playful maze generation (from "Twisty Little Passages" presentation at MWRC 2015)

License

Notifications You must be signed in to change notification settings

jamis/zing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

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

Utilities

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 jamis@jamisbuck.org

If you like this code, please buy my book, too!

"Mazes for Programmers" https://pragprog.com/book/jbmaze/mazes-for-programmers

About

Framework for playful maze generation (from "Twisty Little Passages" presentation at MWRC 2015)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages