Montana Tech of The University of Montana
Computer Science & Software Engineering

CSCI 135
Fundamentals of Computer Science I
Fall 2015



ASSIGNMENT #7 - Wumpus World

In this assignment, you will be writing a graphical program to implement the Wumpus World game. You will gain experience in object oriented design and programming.
  Wumpus World on Android


The Game. The Wumpus World game takes place in a cave with different rooms in it. You can think of it as an NxM rectangular grid. The player always starts in position 0,0, which is guaranteed to be safe (but it may still be smelly or breezy or glittery). The image above is one implementation of the game for Android. Yours does not have to look like that.

The objective of the game is to find the gold. The player will know when he/she is in a room with the gold because there will be a "glitter" in that room. If the player detects a glitter, he/she can pick up the gold and the game is won.

Bottomless pits are present in some of the rooms. There is a 20% chance that any given room will have a pit. All rooms adjacent to a pit are breezy, that is, a player entering a room adjacent to a pit will detect a breeze. If the player moves into the room with a pit, he/she falls in and dies a horrible death.

There is only one wumpus in the cave, and he is also placed at random. Rooms adjacent to the wumpus are smelly, that is, a player will detect a stench in a room adjacent to a wumpus. The wumpus cannot move. If the player enters a room with the wumpus, he/she will be eaten, and, once again, die a horrible death.

There is also only one room in the cave that contains the gold. Unlike the other objects, the player has to be in the same room as the gold in order to detect a glitter. Like the wumpus, the gold is placed at random.

The player can move up, down, left, or right. The player also has one arrow. Once it's used up, it's gone. It can be used to shoot a wumpus, and can be shot in any direction the player can move in. If the player is successful in shooting the wumpus, the wumpus will emit a blood-curdling scream, and will no longer be a threat. The only other action the player can perform is to "grab gold".

When the player first starts the game, he/she does not know (and cannot see) where the location of pits, gold and the wumpus are. The only clues are whether the current room is breezy, smelly, or glittery.

The Assignemnt: The overall assignment is to produce this game with a graphical interface. You are strongly encouraged to work in pairs, though if you absolutely don't want to do this, you are not required to. The assignment is divided into two parts, which have separate due dates.

Part 1: The first part of this assignment is to go through the first two steps in the software development life cycle: Requirements and Design. What you should turn in for this part is first a list of the classes you have identified from the game description above. For each of these classes, you should also identify the information required in each one (instance variables) and their data types, along with the methods and their signatures (the API). This will be a very similar process to what we did in class for the bank example. This should be in the form of a Microsoft Word document.

Part 2: The second part of this assignment is to write the code from your design and implement the Wumpus World game. This covers the next two steps in the software development life cycle: Implementation and Test/Debug. Don't be surprised if, as you write code, you find places where you need to change the design. It's often difficult to think through the problem in enough detail to think of everything as you design the solution. However, if your approach changes, you need to go back and change your design so that it reflects your implementation. What you should turn in for this part is your source code and any files needed to run it, along with your appropriately modified design.

Some images that may help you are below:
wumpus_image.png
player.png
gold.png
stench.png
breeze.png
pit.png

Submission.
Part 1. Submit your Microsoft Word document with your problem description and class design, including instance variables and their data types, and method signatures (the API) using Moodle, under Assignment 7, Part 1.

Part 2. Submit your revised Word document with your revised design, and any program, images and/or text files needed to run your Wumpus World program using Moodle, under Assignment 7, Part 2. Be sure each submitted source file has the required header with your name, username, and a description of the program.



Page last updated: August 16, 2016