Given a cave with a number of rooms, represented as a 4x4 square. There is a wumpus, a pit, a pile of gold in the world. The squares containing the wumpus, pit and gold are initialized randomly when the program is started. For example, if the wumpus, the pit, the gold is at (2, 3), (2, 2), and (3, 3), respectively, then the world looks like:
You are a warrior and required to kill the wumpus and leave the world with gold. Rules in the Wumpus World are:
1. The neighborhood of a square consists of the four squares: north, south, east, west.
2. You can do the following actions (one at a time): Go Left, Right, Up, and Down, Shoot (killing the wumpus), Grab (getting the gold).
3. You can shoot the wumpus in the neighborhood of wumpus square and grab the gold in gold square.
4. You cannot enter the square containing the pit or the live wumpus, or else you will die.
5. Each square is surrounded by walls with a door. So you cannot see what is in the
square before you enter it. But you can smell the stern in the neighborhood of
wumpus square and feel the breeze in the neighborhood of pit square. The examples of stern and breeze can be seen in the figure above.
6. You start the adventure at the square (1,1) and leave the world at (4,4).
1