CS120
Programming Assignment #11

Changed Due Date
Due Friday Nov. 17th at the beginning of lecture.

For this assignment you will be creating a different version of the adventure game. In this version the "map" consists of a 2-dimensional grid of areas. Each area is represented by an "area" object. An area object contains a string of text that describes the area. The strings of text should be read from a data file.

The location of the player is stored in x and y variables. E.g. x = 2, y = 4 means that the player is in area 2,4. The player moves by choosing a direction. If the player reaches the edge of the map they can either be forced to stop or can "wrap around" to the other side of the map.

The program will need to have the following components:

The output for this program should look some thing like:
You are in a dark hallway. There are doors in all four walls.
Would you like to move (1)North (2)East (3)South (4)West?
1

You are on a grassy lawn. To the North is a graveyard, to the East is a swingset, to the West is a reflecting pool. A mansion looms to the South.
Would you like to move (1)North (2)East (3)South (4)West?
99
That is not a valid direction to move in.

You are on a grassy lawn. To the North is a graveyard, to the East is a swingset, to the West is a reflecting pool. A mansion looms to the South.
Would you like to move (1)North (2)East (3)South (4)West?
But feel free to make it more readable.

If you want you could have the program also print the player's location:
You are at location 2,3

For this version of the program nothing happens. The player wanders around, but there's no winning or losing. However, it should be reasonably clear how this could be combined with the previous adventure program ideas to make a "real" game.

Turn in: A copy of the program, a copy of the game file, and sample output showing the program runs. You do not need to print an entire game, but make sure you show how an illegal move is handled and what happens when a player reaches the edge of the map.