Project #6 Hunt the Wumpus Solution



The Pedagogical goals of this project are for you to build something that is slightly more than a toy exercise, to do some additional work with arrays and user input, and (possibly) to use inheritance in your design.

I also want you to have some fun by writing a game. The game It is modeled after an early text based computer game ‘Hunt the Wumpus’. An early adventure / dungeons and dragons kind of game.

Here is the environment you are modeling:

The game is played in a series of rooms in a cave or dungeon.

Each room may have:

  • A bottomless pit

  • Bats roosting in the ceiling

  • The Wumpus. A monster that sleeps a lot.

  • A number on the floor that identifies the room

  • Footprints indicating you have been there before.

You move around the maze trying to find the Wumpus so you can shoot him with your arrow. ( IE you stand in a ‘safe’ room and shoot into the room the Wumpus is sleeping in)

  • If you move into a room with a pit – you will fall into the pit and die.

  • If you move into a room with the Wumpus – he will wake up, eat you and you will die.

  • If you move into a room with a bat – the bat will pick you up and move you to some room at random. This may result in your death if it has a Wumpus or Pit. After the bat moves you into a room at random, the bat will relocate to some room in the maze at random ( that does not already have a bat)

  • If you move into any room and do not die, the system will print out the room number. If you have been there before the computer will tell you “You see footprints in the dust”

  • If you shoot an arrow into a room that does not contain a Wumpus, the Wumpus will wake up and move at random to an adjacent room, or will stay in the current room ( 20% chance of each)

When you are in a room – you may:

  • Hear bats in the distance ( There are bats in an adjacent room )

  • Smell something rank ( The Wumpus is in an adjacent room)

  • Feel a draft ( There’s is a pit in an adjacent room )

In all of these cases the computer will print out and appropriate prompt

You can take the following actions in a room:

  • Move to a new room using the keypad ( i, j, l, m – up , left, right, down)

  • Shoot an arrow into the adjacent room ( shift I, j, l, m)

  • Enter the string ‘map’ that will print out the maze, your location, indicate Wumpus, Pits, and Bats location

Misc facts:

  • You have four shots. Make them count. If you shoot all arrows without killing the Wumpus you lose.

  • The Wumpus has suction feet so he will not fall into a pit.

  • The Wumpus is too heavy for the bats to lift.

Other things about the set up

  • Start with an 8×8 maze

  • Start with 4 rooms with pits, and 4 rooms with bats

  • You may either make the edge of your maze have walls ( in which case you need to modify your descriptions such as “The way to the east is blocked by a wall”) -OR- you may make the passage ways magically wrap around the edge of the maze.

  • Feel free to play with the rules and have fun. But you will be graded on what is presented above.

error: Content is protected !!