Task 098: a maze generator which directly outputs SVG

The task is to generate a simple (but solveable!) 2D maze, and output it in SVG format. The input parameters are the size of the maze (how many cells it should have, both horizontally and vertically), and where the maze entry and exit should be located.

Maze

Inspiration

An overview of algorithms for automatic maze generation. You are free to use any of these techniques, as long as the end result is sufficiently non-trivial. You are of course also welcome to derive your own approach.

Program Environment

The application 098svg from the repository grcis serves as the basis of this project. This is a simple console application which can read parameters from the command line, or from a specified text configuration file. After starting up, it generates an output SVG (or HTML) file that can later be viewed in your favorite Web browser (tested on Chrome, Internet Explorer).

Details

The maze we are working with is rectangular, and defined over a regular 2D grid that has its dimensions (number of columns and rows) specified at runtime. Each interface between two neighboring cells is either empty (passable) or there is a wall. There is a continuous wall around the maze, except in two spots: at the start and finish point.

The start and finish cells are to be specified via their integer coordinates [x, y]. You should highlight these two points in the final SVG output (e.g. by placing a red and blue dot at those locations, or something like that). You can also allow a random selection of start and finish locations.

An optional extension of the task lies in the possibility of defining an "intermediate goal", through which each path from the start to the finish has to go. It is not a given that the maze must have only one unambiguous solution, see also the next paragraph.

Another interesting extension could be to make the difficulty of the maze controllable. We leave the details of this to your creativity (this is a way to earn extra points). Not all classical algorithms have a "difficulty parameter", so you might have to invent something to make this work.

What to hand in

Send the file Program.cs via mail to the lecturer.
In the first line, put your name in a comment.

Deadline

Hand in the assignment until: 13. 11. 2022

Points

Basic: 9 points (reasonably looking maze based on the input parameters, highlighted start and goal),
Bonuses (1 to 7 points):
 up to 2 points for a meaningful definition of maze difficulty (provided as a comment in the implementation file),
 up to 2 points for working implementation of the maze difficulty parameter,
 up to 2 points for more complex topology (e.g., hexagonal, triangular, circular),
 additional points for creativity and/or technical merit.

Project

Visual Studio project: 098svg.


Copyright (C) 2016 J. Pelikán & A. Wilkie, last change: 2022-10-20 21:06:58 +0200 (Thu, 20 Oct 2022)