The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Use Python:
Â
Description
Many years ago (in the 1970s and 1980s), most computer games didn't have fancy graphics or elaborate controls. Instead, they took the form of "text adventures" like Adventure (AKA Colossal Cave Adventure) and the Zork series, where the game presented written descriptions of various locations in the game and players typed in commands to move around and solve puzzles (this genre still exists today under the title of "interactive fiction"). Some of these games became extremely elaborate, featuring dozens or hundreds of in-game locations and the ability to understand complicated commands (e.g., "open the door with the green key", not just "open door"). For this assignment, you will write a parser that reads in a data file written in a special format and runs the resulting text adventure game. We won't create anything as sophisticated as the classic text adventure Zork, but we will still support a number of basic commands and simple puzzles.
Â
Part 1: Loading the Data File Every game consists of a collection of locations, called rooms. Every room has four required pieces of information:
• A unique room number (this value is used internally to track the player's current position; it is hidden from the player)
• A room title (a word or short phrase that identifies the room, like "Kitchen")
• A room description (a string containing a text description of the room's appearance). A description may be specified using multiple lines of the data file.
• A list of exits (directions that the player may go to travel to a different room). A room may have exits in any combination of the four cardinal directions (north, south, east, and west).
.........................(continued in Homework_3.pdf attached)
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly