|Maze.pm - Simple rectangular mazes|
Maze.pm - Simple rectangular mazes
David M. Chess, email@example.com
use strict; use Maze; srand(); # The module doesn't do any seeding itself
# create a simple maze, twelve corridors high and eight wide my $maze = new Maze(12,8);
# Display it as ASCII art print $maze->display_ascii();
# Or as a bunch of IMG tags (images in ../gifs/) my $tags = $maze->display_html("../gifs/");
2000/12/18 - First release version, 1.00 2000/12/19 - Allow specifying where the images are, 1.01
returns a new maze object of the given height and width (in ``corridor'' units).
returns a string representing the maze as a primitive bit of ASCII art, as in:
*--*--*--*--* * | | * *--*--*--* * | | | | *--* * * *--* | | | * *--*--*--*--*
returns a string representing the maze as a bunch of HTML ``IMG'' tags.
The tags returned will reference images called ``post.gif'' (used for the ``posts'' where walls come together), ``vwall.gif'' (a vertical wall), ``hwall.gif'' (a horizontal wall), ``vopen.gif'' (a vertical open space, where there isn't a wall), ``hopen.gif'' (a horizontal open space, where there isn't a wall), and ``hall.gif'' (the open areas between potential walls). All image names will be prefixed with the given prefix, if given.
post.gif, vwall.gif and vopen.gif should all be the same width. hall.gif, hwall.gif and hopen.gif should all be the same width. post.gif, hwall.gif and hopen.gif should all be the same height. hall.gif, vwall.gif and vopen.gif should all be the same height.
Got all that?