Home
C Sci 40 - Second Project Due Date Classes

By the second project due date navigation should work.  I wrote an example program that is my recommendation for how navigation should be implemented.  There is an emumerated data type, roomName, that lists all the possible "rooms" you might go into during the game.  I have listed three:  BANANA_TREE, ISLAND, and GANGPLANK.  You will list all the rooms your game will have.  You can always add more for extra credit later.  I also included a struct, roomType, that contains all the information about the room.  I have included strings for the long and short descriptions, bools for the items that may or may not be in the room, and 6 fields of type roomName that hold the locations of where you go when you leave the room.  For example when you go south from the island, you are on the gangplank, so the value of "exitSouth" in the room "ISLAND" has the value "GANGPLANK".  I have set these values in the finction "initialize". 

There are a few other recommendations also.  I created a struct "playerType" that contains information about the player, including what room he is in, what he is carrying, and his name.  I suggest your character in the game be a variable of type playerType.

Finally, start delegating jobs to the other group members.  Have one group member write a function that converts a word or sentence to Pig Latin.  It should be a function with one parameter of type string, that returns a value of type string.  The input is English and the output is Pig Latin.  Another group member might do all the typing for the initialize function.  Perhaps the long and short descriptions for the rooms could be read from a file; have someone write the file and the function that reads it.  Perhaps someone could work on the two-word commands, like "take knife" or "cut bananas".