Description:

For this project you are to create the game Hunt the Wumpus. This is a simple game where the hero attempts to hunt down a monster called the Wumpus and shoot him with his arrow. The Wumpus World could look like the maze shown below. see image.

The hero starts in the lower left-hand corner of the maze. He can move up, down, left or right on each turn providing he does not move off the grid. There are pits in the maze that the hero should try to avoid. If the hero moves into a location with a pit, he falls to his death and the game is over. If the hero moves into the square with the Wumpus, the Wumpus will eat him (a very unpleasant way to go which also ends the game)! In each location in the maze the hero can detect what may be around him through his senses. In squares next to pits the hero will feel a breeze. In squares next to the Wumpus the hero will smell a stench (due to the fact that the Wumpus has not bathed in three centuries)! The hero has one and only one arrow he can fire to try and kill the Wumpus. If the hero fires his arrow into the square with the Wumpus he slays the Wumpus and wins the game. If he fires his arrow into the wrong square, well, let's just say that the Wumpus enjoys snacking on defenseless humans!

Requirements:

You should simulate the maze with a two dimensional array of characters (which is 6 across and 4 down). The above maze is just an example of what the Wumpus World could look like. Have the program randomly determine where to put the Wumpus and the four pits. However, make sure you do not put the wumpus and pits in the same location as where the player starts. As players play the game give them the following options: ud,1,r,s (for move up, move down, move left, move right, and shoot arrow). If players attempt to move off the grid tell them they bump into a wall. If players move to a square next to a pit tell them they feel a breeze. If players move into a square next to the Wumpus tell them they smell something so bad it makes their stomach churn! If players choose to shoot their arrow then prompt for a direction: (und,1,r). If the Wumpus is the direction the arrow is shot then the player wins. Otherwise, the player loses. Players also lose if they move into a square with a pit or the Wumpus.

At the end of the game, you should display the maze to the screen. You can display it in any way you like, as long as it is clear. Something like this would be fine:

0 0 p 0 0 w
0 p 0 0 0 0
0 0 0 0 0 p
0 0 0 p 0 0

(where 'O' indicates an empty square, 'p' a pit, and 'w' the wumpus)

Happy Hunting!

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.