CS 367 - Introduction to Data Structures - Section 3

Programming Assignment Two: Mapping a Maze

Due Thursday, November 13, 1997 by 2:30pm



Contents


The Game

Imagine you are an adventurer trapped in a dungeon. Your goal is to find the exit, escape, AND reproduce a map to the exit so that future explorers can escape with ease.

This assignment concerns a simple game called aMAZEd. The object of the game is to find the exit to a maze within a limited number of possible moves. Documentation for how to play the game is available in the README file.


The Assignment

Unlike the previous assignment, this assignment compiles from the get-go. You can try out the maze, play around and even "win".

Your goal for the assignment is to augment the game so that the player can keep a "map" of where he or she has been in the maze. Then upon the proper keystroke, the user can return to the point at which the initial map was created. Actually you will implement two "maps" one permanent map to keep track of the route from the start to the exit. If the player wins the game, this map (call it map0) should be illustrated by showing (actually reenacting the moves) from the start to the finish. The second map (call it map1) is for the player to quickly get back to some point. If the the clear button is hit, the current map (map1) is erased and you start mapping from that point. Upon hitting the reset button, the player should be quickly returned to the place where map1 was last cleared (or the start position if clear has not yet been hit).

The assignment is intended to:


Requirements

This assignment is not meant to be difficult. It is meant to be fun.

You need to implement the following actions:

You also need to implement map0 - the complete map from the start to end position. Upon winning the game, you should move the player from the start to the exit.

Both maps should take note if you reverse directions. If you go east twice and then west once the map should indicate you have just gone east once.


Extra Credit

There are several more advanced features you can implement if you choose. If you do choose to do them, make sure the basic requirements are met completely, first. (See grading below.)

Examples of extra credit:

You can work on other aspects of the program, but clear them with me first. You may wish to view the sources of the other program components and possibly modify them to achieve your enhancements to the game. If you wish to do this contact me and I will make those sources available to you.

Any extra credit work must be well documented in a file you submit called EXTRA-CREDIT.

Extra credit is designed to make up points lost on previous assignments or the first exam. If you do not need the extra credit, please do not submit it (of occurs, feel free to try it anyway).

You might think about augmenting this program more substantially for a final project.


Grading

This program will be graded in two phases (three if you are doing the extra credit). Since the program compiles to begin with, you will get 75 points off if it does not compile at submission time. However, error-free compilation itself will be worth only 10 of the maximum 100 points. The remaining 90 points will distributed as follows: Extra credit work will likely not be graded until after the second exam.

For more information on grading policy, click here.

Program Two has been graded. You can find your grade in the directory

~cs367-3/Submissions/Two/<login>
where <login> is your login. The file is called grade. To view your grade file you can type:
cat ~cs367-3/Submissions/Two/<login>/grade
where <login> is your login.


Files

You can modify any of the source files you wish. You need only modify one of them: play.C, which is the read-evaluation loop. The code is marked with comments which hint as to where you will need to make changes. The file you need to do the assignment are located in the directory ~cs367-3/Assignments/Two/Files/. Note that of those files only the .h files, play.C, and Makefile are actually text files. The .o files are object files that have been produced by compiling C++ files that are not needed for the assignment. You should copy the file by using the copy command since .o files are not designed to viewed by a web browser and are not likely to be copied well by them either. As a reminder, if you are currently in your working directory, type:
  cp ~cs367-3/Assignments/Two/Files/* .

How to get started


Submitting

What we need once you are done: two files: your version of play.C and a text file describing what you have done (in English) called EXPLAIN. EXPLAIN need not be long and should not be complicated. Basically it should state which data types you used to accomplish the enhancement to the game and how you used them. You can submit additional files if necessary, but bear in mind that the compile grade hinges upon our ability to compile your file with the other files remaining intact. Copy the necessary files to the directory ~cs367-3/Submissions/Two/<login> where <login> is your login name. For example if your login name is foo, then from the directory where your modified bag.C file is located, type:
cp bag.C ~cs367-3/Submissions/Two/foo 
This is a paperless assignment. You need only turn in the program electronically. However, Marc will be able to examine your code more easily and provide better feedback to you if you do submit paper version of EXPLAIN and play.C. If you do any extra credit, submit a file called EXTRA-CREDIT indicating what you do on top of the required work.


Solution

A compiled executable derived from the solution is available for you to try out. The solution executable can be found at in the directory:

~cs367-3/Solutions/Two/
Go there and type amazed to check it out.

The instructor's solution to Program Two is available in:

~cs367-3/Assignments/Two/Solution/
This directory contains not only the solution version of play.C and game.h but also the source to the other components.


Late Policy

The assignment is due on Thursday, November 13 at the start of class. However, you may submit it as late as Tuesday November 18 at the start of class with NO penalty. Note: You must submit it by the first deadline (11/13) to guarantee that it will be graded by November 21 - in time for you to use the feedback to for your exam preparation.

Past November 18 at the start of class, late assignments will not be accepted. If you feel you truly have a justifiable excuse for turning in the assignment late, you must clear it with me at least one day in advance. (I do not plan on clearing any such requests.)