Projects - PHP Maze Generator

Project Details

A maze generated with php
Completion Date: November, 2008
Language: PHP
Requirements: A webserver with PHP installed and GD support.

Before writing the code for the C++ Maze project I explored the problem briefly in PHP to allow me to make better decisions about the data structures and techniques which would underpin the C++ program. The PHP Maze Generator uses the GD library to display the generated maze.

The program implements a randomised Depth First Search algorithm which creates mazes. There is a link below to a live example of this script which will generate mazes of any size up to a width and height of one hundred cells. This limit is forced by the limitations of the webserver and PHP. However, there is also a link to downloadable PHP files. If these are installed and run on a webserver, they can generate mazes of almost unrestricted size.

Downloads

Live PHP GD example
Random mazes are generated in real time. The user must specify the size of the maze. The image is generated using a Depth First Search algorithm and is rendered using the PHP GD library.
Live PHP GD files
The archive contains all files necessary to generate mazes using PHP. To use the files they must be uploaded to a webserver with PHP and the GD library installed. To see the result without setting up these files please use the "Live PHP GD example" link.