humanities

...u assigned in order to win the game. 3. MISCELLANEOUS Some options are miscellaneous in nature. "QUIT" allows the user to end the simulation. "LOOK" is used to reprint the room descriptor text. "INVENTORY" gives a list of what the explorer is currently carrying. "SCORE" is used to print out the current score. The scoring algorithm should include visiting major park sights, completing portions of the trail, and depositing items at the Inn. NOTES: You are allowed to work in groups of five or six on this program. Your code must be well documented. You are required to use objects to represent the rooms and the physical objects in the simulation. For the simulation, you must implement the following "rooms": all of trails 3 and 6 (the rooms are shown as either open or close), the entrance, the gate house, the parking lot, and the Inn. By some of the rooms there are objects listed: these are the rooms where the given objects are to be initially located. This program is worth a total of 100 points. Extra credit is available, at the discretion of the instructor, up to a maximum of an additional 150 points. To receive extra credit one must successfully implement a feature that is clearly beyond what is called for in the specifications. Examples would be a larger vocabulary, having consumable items, adding additional "rooms," using the random number generator to simulate being "lost in the woods" if one strays off the trail, displaying graphical text images of rooms (and objects), assigning weights to objects and having a maximum capacity on the amount of stuff you can carry, or a save and restore game feature. The best approach to writing this type of program is to create an adventure "engine" where data files are used to specify the rooms, their descriptions, and their interconnections; and another one is used for describing the objects. For example, if we were to go with an extra credit grabbing full-blown implementation that included photographs of the scenery, we might go with the following format for the room data: 1: room number. Rooms are sequentially enumerated beginning at zero. 2: six integers indicating the ability to travel (in order) north, south, east, west, up, or down from the current room. The value ?1 is used to indicate that one cannot travel in that direction; any other value indicates the room number of the room that would be visited if one travels in that direction. 3: points received for visiting this room. 4: one line (i.e. short) description of where you are. Short descriptions are often used when revisiting a room. 5: start of (long) descriptive room text. Text will be formatted on the display exactly as it appears in the screen. Multiple lines are permitted; you may assume that a single line of input contains no more than 80 characters. The word END at the beginning of a line is used to indicate the end of the descriptive text. Partial (i.e. fragmentary) example of a room data: ROOM 3 -1 ?1 -1 0 -1 ?1 5 You are at the shores of Lake Lonidaw. You are at the shores of Lake Lonidaw, a kettle lake formed by a glacier from the last ice age over 12,000 years ago. It's quiet and peaceful here. A path leads to the west. END ROOM 4 5 2 -1 -1 ?1 ?1 0 You are in the parking lot. You are in the parking lot. The are a lot of cars here; fortunately, there are still a couple of parking places available. The trailhead for trail 3 is to the north; the entrance to the Potawatomi Inn is to the south. END Objects can also be represented in the following. For this example, 4 2 5 hiking staff 3 0 3 deer 2 0 6 can of Spam In this example, there are four fields: three integers followed by a string. The first field is where the object is initially located; please note that it is possible to have more than one object present in a room. The second field is the room where the object is to be deposited for credit. The third field is the number of points received for depositing the object in the "credit room." The last field contains the name of the object. Please note that these are examples; you are free to design your own format specifications. To submit your assignment, please turn in to Cyrus Gabilla an electronic copy (via email, CD, or zip disk) of all of your source code files. In addition, you are to hand in at classtime a printout of your source code, plus a sample run that visits all of the rooms, illustrates all options, and successfully completes the game. Some students will be asked to demonstrate their programs at the final laboratory session. The following section consists of sample text that illustrates how the descriptive text is written, as well as the "look and feel" of the simulation. Sample user input is shown in bold italics. You are to write the room description text for this simulation, using the provided trail descriptions as a guide. Room descriptions that get into the spirit of things may receive an extra point at the instructor's discretion, up to a total of 10 points (one point per room). SAMPLE ROOM DESCRIPTIONS WITH EXAMPLE COMMANDS Room 0 (Entrance): You're driving on highway 727. To the right there is a sign: WELCOME TO POKAGON STATE PARK Gate house ahead - be prepared to stop The road continues to the west. > GO WEST Room 2 (Gatehouse): You are at the gatehouse to the Park. On the front of the gate house there is a sign: ENTRANCE FEE: $2 PER CAR Inside the gate house there is a park attendant looking at you. > GO WEST Room 2 (Gatehouse, after trying to drive through without paying the entrance fee): You are at the gatehouse to the Park....

Essay Information


Words: 1897
Pages: 7.6
Rating: None

All Papers Are For Research And Reference Purposes Only. You must cite our web site as your source.