Building a Maze

In this task, you will implement a program that builds a maze. You will implement a disjoint set and use it to help you build the maze. You will build the maze as discussed at the end of the Disjoint Sets lecture (and at the end of chapter 8 in the book). To review, initially your maze will have a wall surrounding each cell in your maze. Randomly choose an interior wall of the maze, if the wall separates two cells that are in different sets, remove the wall and union the two sets. If the wall separates two cells that are in the same set, don’t do anything. Repeat this process until all cells are in a single set. Once you have built your maze, you will need to output this maze as an SVG Image file (.svg). You will also need to create your own branch using git and submit your code in that branch.

Here are some of the key components of your implementation:

  • DisjointSet class
    • You may use any method you like to handle disjoint sets.
    • Need to implement the find and union functions for your disjoint set.
  • Other classes
    • You may choose to create or not any additional classes.
    • I would recommend creating some sort of maze builder class that builds the maze (contains which walls are there and which have been removed) and “prints” out the maze as a .svg file using the DisjointSet class.

A note about SVG files:

Scalable Vector Graphics (SVG) is an XML-based vector image format for two-dimensional graphics with support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium (W3C) since 1999. SVG images and their behaviors are defined in XML text files. This means that they can be searched, indexed, scripted, and compressed. As XML files, SVG images can be created and edited with any text editor, as well as with drawing software. All major modern web browsers—including Mozilla Firefox, Internet Explorer, Google Chrome, Opera, Safari, and Microsoft Edge—have SVG rendering support. (https://en.wikipedia.org/wiki/Scalable_Vector_Graphics)

I will provide a sample .svg file you may use as a basis for creating your own. You will be able to open this file using your preferred web browser to view your created maze.

Requirements

You will be creating this code from scratch. You will also need to create your own Makefile to build, run, and clean your files. You should reference past Makefiles when creating yours (it should only require small modifications of past Makefiles). Your code must do the following:

  1. When the “make maze” command is called, your program must produce an SVG file named maze.svg.
  2. maze.svg must be a 20×20 maze
  3. make maze must run in less than a minute on the EECS ssh servers (it should likely take less than a second though).
  4. When the “make bigmaze” is called, your program must produce an SVG file named bigmaze.svg.
  5. bigmaze.svg must be a 50×100 maze (50 cells tall by 100 cells wide)
  6. When “make clean” is called, all files created by your program and make calls must be removed (including any maze SVG files as well as your program executable file).
 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.