Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the language is c++ and need to run it in code blocks The hero starts in the lower left-hand corner of the maze. He can

the language is c++ and need to run it in code blocks

image text in transcribed

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: u,d,l,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: (u,d,l,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 0 indicates an empty square, p a pit, and w the wumpus)

Happy Hunting!

additional code (compulsory)

Modify the program so that if the arrow is shot it can be found again by looking around in the maze. Thus, the program would not end if the arrow is shot and it misses the wumpus. Instead, the arrow is placed in a random location in the maze (not already occupied by the wumpus and the pits).

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 breeze breeze breeze- breeze , breeze breeze-breeze- breeze breezer stench breeze - Start stench stench 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 ires 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe what is physically happening when a wing stalls

Answered: 1 week ago

Question

What are the challenges associated with tunneling in urban areas?

Answered: 1 week ago

Question

What are the main differences between rigid and flexible pavements?

Answered: 1 week ago

Question

What is the purpose of a retaining wall, and how is it designed?

Answered: 1 week ago

Question

How do you determine the load-bearing capacity of a soil?

Answered: 1 week ago

Question

what is Edward Lemieux effect / Anomeric effect ?

Answered: 1 week ago