Project 5: RanMaze

Random maze generation using Partition

Version 10/11/17

Educational Objectives: After completing this assignment, the student should be able to accomplish the following:

Operational Objectives: Implement a random maze generator as a client of fsu::Partition.

Deliverables:

ranmaze.cpp   # client program of Partition <> generating random mazes
makefile      # creates targets ranmaze.x, solvemaze.x
log.txt       # development and testing log

Procedural Requirements

  1. The official development/testing/assessment environment is specified in the Course Organizer. Code should compile without warnings or errors.

  2. In order not to confuse the submit system, create and work within a separate subdirectory cop4531/proj5.

  3. Maintain your work log in the text file log.txt as documentation of effort, testing results, and development history. This file may also be used to report on any relevant issues encountered during project development.

  4. General requirement on genericity. Use generics whenever possible. For example:

    1. If you need to sort, use a generic sort algorithm or a container with built-in sorting.
    2. If a sort requires a specialized notion of order, create a function object that captures the desired order property.
    3. If you need a graph algorithm, use a component of the fsu graph library.
    4. In general, whenever a generic algorithm exists that can be deployed, do not circumvent that with specialized one-off code.
    5. Carefully choose all containers as the most appropriate for a particular purpose.

    In short: re-use components from LIB (or your own versions) whenever possible. Don't re-invent the wheels.

  5. Begin by copying all of the files from LIB/proj5 into your proj5 directory along with relevant executables from area51. You should see at least the following:

    deliverables.sh        # submission configuration file
    ranmaze_i.x            # sample executable
    mazemaster.x           # maze analyzer
    

    Execute ranmaze_i.x to generate maze files and mazemaster.x to analyze the resulting maze files. You will follow the same process in testing your own ranmaze and its resulting maze files. Also pay careful attention to the detailed I/O behavior of ranmaze, this is how your program should behave.

  6. Create the file ranmaze.cpp, a client of Partition<>. Using mazemaster.x, test thoroughly to be sure the mazes it generates are self-consistent and that the behavior mimics that of LIB/area51/ranmaze_i.x, including the file name extensions for output files.

  7. Check that ranmaze.cpp meets the specifications given below.

  8. Be sure that you have established the submit script LIB/scripts/submit.sh as a command in your ~/.bin directory.

    Warning: Submit scripts do not work on the program and linprog servers. Use shell.cs.fsu.edu or quake.cs.fsu.edu to submit projects. If you do not receive the second confirmation with the contents of your project, there has been a malfunction.

Code Requirements and Specifications - ranmaze

  1. Output maze files according to the spec in the Union-Find notes Appendix: Maze Technology. Take care that all maze files are syntactically and semantically correct - mazemaster.x is helpful in testing your output.

  2. The maze file should have the start cell at the beginning (left-most cell) of the middle row and the goal at the end (right-most cell) of the same row.

  3. ranmaze should expect three command line arguments: number of rows, number of columns, and filename.

  4. ranmaze should output two versions of the random maze: (1) the first time goal is reachable from start, output the maze to the file "filename.[components]" where [components] is the actual number of components in the maze; and (2) after all cells are reachable from start, output the maze to the file "filename.1".

  5. Take care that your mazes are correctly "random" in the sense that all walls have the same probability of being selected for inspection at each step. This is mostly a matter of judicious design, especially at boundary cases. For example: be sure that a cell face on an interior cell has the same chance of selection as a cell face of a boundary cell, where fewer faces are eligible.

Hints - ranmaze

Hints - visualization