automaze

description

automaze is a maze generator library for ruby. some algorithms include.

ex) Boutaoshi (simple) DugTunnels (little complex)

installation

gem install automaze

usage

require "automaze"
maze = Automaze::Automaze.new
puts maze # printing maze

# access panels(x, y)
panel = maze.panels(3,4)
panel.wall? #=> true or false

# each panels
maze.each_panels do |panel,x,y|
  if panel.wall?
    print "XX"
  else
    print "  "
  end
  puts if x == 0
end

specifying generation algorithm

Automaze::Automaze.new(:algorithm=>:boutaoshi)