© 1998-2018, Jeffrey T. All rights reserved. Hosting by
Your ad here, right now: $1.10. Resident evildoer and tormentor of geeks Trudy has stolen Nick's, Ki's, and Fooker's paychecks and has hidden them in a maze of dark cubicles, filled with treacherous black holes! Can you help the gang find their way through the vile labyrinth to grab the cash and escape to eat another day? Find out in Trudy's Wumpus World! What is a 'Wumpus World'? The is a very simple game devised to help teach the concept of intelligent agents in artificial intelligence.
In the classic Wumpus world, the 'player' is an artificially intelligent computer program which must make some very important decisions. It must travel through a darkened cave, try to find the hidden gold, and escape back outside without falling into a bottomless pit or being devoured by the repulsive Wumpus, a huge hungry brute that eats any living thing it comes across. It's not as easy as it may sound because a good AI program must be very complex to remember where it is going and where it has been. This time, however, the rules have changed somewhat. Trudy replaces the Wumpus, your paycheck is the gold, and you are the player. And to make things more interesting, you're not alone in the maze, as the computer controls another one of the GPF gang, also trying to beat you to the check and out the door! How to Play
Your ad here, right now: $1.60 To play, you must first click on one of the three pictures below to pick your character. The computer will then pick another character for itself. Then you and the computer player will be placed into Trudy's Wumpus World, which consists of a darkened room filled with individual cubicles. You cannot see anything, so you will have to rely on your other senses to help you. You can travel from cubicle to cubicle by clicking the up, down, left, and right buttons that appear. The room is of limited size, so you may bump into a wall if you're not too careful. There are number of dangers throughout the room to worry about.
First, Trudy has used a black hole generator to create tiny black holes throughout the room. If you enter a cubicle with a back hole in it, you will be immediately sucked into it and be lost forever! Plus, Trudy herself, armed with really big mallet, roams the maze, ready to whack you over the head if she finds you. Fortunately, you do have a little warning. If a black hole is in a cubicle adjacent to the one you are currently in, you will feel a slight breeze.
Similarly, if Trudy is nearby, you will smell her (sickeningly sweet) perfume. Note that this doesn't tell you which adjacent cubicle the black hole or Trudy is in.
You will have to deduce this yourself. Your goal is to find your paycheck, which Trudy has cleverly hidden somewhere within the maze of cubicles. You cannot tell which cubicle the paycheck is in until you're right on top of it (i.e. In the same cubicle). Once you find it, you will have to make it back to your starting position to win the game. Unfortunately for you, the computer's player is trying to do the same thing, and there's only one paycheck!
(It must be a blank check, so you can write your own name in.) Each computer player plays a little bit differently: Nick is conservative, cautious, and has an excellent memory (he takes copious notes). While this means he rarely fails, it does make him slow. Ki occasionally takes a chance or two for the sake of speed and she may on rare occasions get confused and forget where she's been. Fooker is fast, aggressive, reckless, and doesn't always pay attention (he's easily distracted by shiny objects). While he's the most likely to take a wrong turn, he's also the one who tends to find the paycheck fastest. All three know only what you know; that is, they can feel a breeze or smell the perfume, but that's all they know. They don't cheat.
You might want to take notes as you play as you can be sure that they will too. A note or two to remember: It is possible for Trudy to be in the same location as a black hole, since she conveniently has an anti-gravity belt. Thus, feeling a breeze and smelling Trudy's perfume at the same time doesn't necessarily indicate anything by itself.
The paycheck will never be in the same cubicle as Trudy or a black hole, so there won't be any no-win scenarios where you can't reach the paycheck without dying. That said, it is entirely possible that there may be no safe route from your starting location to the paycheck (i.e. Every route might be blocked by Trudy and various black holes), so there may be no way to win a given game! Statistically, you should be able to win most games, but be forewarned that you may not be able to win at all! By default, the room consists of a grid of cubicles five wide and five deep.
However, to make the game more challenging, try increasing the grid size using the drop-down list below. Ready to try your luck in Trudy's Wumpus World? Good luck; you're going to need it! Your browser must support JavaScript to play this game.
. Welcome to! First time visitors of Daily Programmer please to learn everything about this subreddit. Can't submit solutions? If you are a new or unverified account, and are unable to post comment replies, please click to verify your account.
Guitar sargam lessons book pdf. Otherwise, read the for a walkthrough of submitting a solution, or click below to message the moderators for assistance. Write your own challenge! To help the community and write your own challenge to be submitted, head on over to and share your project - read the sidebar in that subreddit for more information.
Description: Across the land the people whisper 'Beware the Wumpus. For it slumbers in the cave up yonder in the hills. Only the brave seek him.'
This challenge will be about implementing a simple rogue like game. You will create a game engine that will accept simple commands from the user. You will parse the commands and process them. You will score the moves with a point system. The goal of the player is to score the most points with 1 life. The cave will be a randomly generated N sized cave.
Design: Cave Creation: On running the game the user picks the size of the cave by entering a number N. This creates a cave NxN in size. N must be 10 to 20 in size. The cave has rooms that scale with the size of the cave. The location of these rooms are picked randomly and the amount of each type is fixed on single number or percentage of how many rooms in the cave. Entrance: Only 1 of the rooms must be an entrance/exit point. This is where the player controlled hero spawns and can choose to leave the cave to end it.
Gregory Yob
Wumpus: 15% of the rooms must spawn a Wumpus. (A monster your hero seeks to slay). So if you have 100 rooms, 15 of them will spawn a Wumpus.
Pit Trap: 5% of the rooms must be a pit trap. If you walk into this room you fall to your doom.
(And the game is over) Gold: 15% of the rooms must have a gold to loot. Weapon: 15% of the rooms must have a weapon on the ground for the player to pick up to use for slaying monsters. Empty: The remainder of rooms not assigned one of the above will be empty. Game Engine: The game engine is an endless loop. It will display to the user basic info for the game and prompt for a single letter command.
It will parse the command then refresh the basic info and continue to prompt for a move. How the Game Ends:. The hero leaves the cave by the entrance. The hero dies by moving into a pit trap room. The hero dies by moving into a room with a Wumpus without having picked up a weapon. The player chooses X to hard exit out of the game right of way. The player scores points.
The higher the points the better they do at the game. The following is the point system. Point system:.
Explore an empty room not visited before: 1 point. Find and Pickup a weapon: 5 points. Find and kill a Wumpus: 10 points. Find and loot gold: 5 points Game Commands: When prompted the following commands can be entered and causes an action for the player: (Note: Case insensitive - uppercase shown for easy to read).?
- help to show this list of moves a player can make. N - move north 1 space - cannot move north if the cave ends (outside of grid).
S - move south 1 space - cannot move south if the cave ends (outside of grid). E - move east 1 space - cannot move east if the cave ends (outside of grid). W - moves west 1 space - cannot move west if the cave ends (outside of grid). L - loot either gold or weapon in the room. R - run out of the cave entrance and head to the local inn to share your tale. X - this is a hard exit out of the game. The game ends with no points awarded.
Environment Changes: As the game progresses the cave changes based on the actions. Once a weapon is picked up all other weapon rooms turn into gold rooms. Entering a Wumpus room with a weapon that has been picked up instantly slays the Wumpus and turns that room into an empty explored room (only points for kill the Wumpus are given not points for exploring an empty room as well). Picking up a weapon/gold will turn that room into an empty explored room (only points for the items and not for exploring an empty room) Understanding Walls & Environment: There are walls surrounding your cave. So for example if you pick N to be 10 you will have a 10x10 cave. But really the cave is 12x12 with the Border of the Cave being Walls. You cannot go in a direction that would put you into a wall.
(This is not a game for mining) Trying to move into a wall will display an error describing how you bump into a wall or such and continue then to redisplay the current room you are in and prompt for another command. As you move in the cave you will be given hints to nearby dangers (see below on output). If to the n, s, e, w of your position you are next ta Wumpus you will 'Detect a Foul Stench in the Air'. If to the n, s, e, w of your position you are next to a pit trap you will 'Hear a howling wind'. There are no clues to being near an empty room, gold or weapons.
Input & Output: Start of Game: either pass the N size of the cave as a start up value, you can prompt for it, you can hard code it. Whatever you like but somehow you must set the N value of the cave.
Status: The program will give status to the user in the following format (Ascii Display of surrounding rooms) (Description of Room you are in) (Environment Clues/Description) x Points Earned You are (Weaponless/Armed). Enter Move (? For help) Ascii Display You will show the 8 rooms surrounding you. Use the following ASCII values to represent rooms as such.
@ - the hero in the middle of the 9 rooms (8 surrounding and the one in the middle which you occupy).? - unexplored room that could be empty, weapon, gold, wumpus or a pit trap.
explored/empty room. # - wall showing the boundary of the cave. ^ - Entrance to the cave where you can run out. W - weapon in an explored weapon room that you did not bother to loot which would be odd. You can't beat a Wumpus Unarmed. $ - gold in an explored gold room that you did not bother to loot. Not looting this means you did not understand the goal of the game.
Examples: You are in the upper left corner of the cave. Just left the entrance and started to explore. Hey why did you leave that gold there? You are not having luck finding anything right now ###.@. Description of Room: Examples of how you might describe the rooms.
Feel free to customize to your liking or humor. Entrance Room - you see see the entrance here. You wish to run away? Empty Room - you see nothing which is something Pit trap - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhh noooooooooooooooooo Splat Wumpus Room - Overwhelmed in Stench a Wumpus stands before you ready to eat you. Gold Room - before you lies the the gold of adventure seekers who feed a Wumpus Recently Weapon Room - Cast before you in a rock a sword awaits to be looted and name yourself King.
Environmental Clues/Description: This is giving you clues to nearby threats as well as describing any battles if you enter a room with a Wumpus and you are armed. If next to a pit room you see a message like 'Howling Winds Fill the Room' If next to a Wumpus room you see a message like 'A fowl Stench fills the room' If you enter a room with a wumpus you describe if you kill it or you get eaten based on if you have a weapon or not. If you enter a pit trap room - have fun describing how one falls before showing the game over.
So putting it all together you might see these screen shots ### #@? Empty Room - there is nothing here but air. You hear howling winds. 10 points earned You are weaponless. Enter Move (? For help) ###.@. Empty Room - there is nothing here but air.
23 points earned You are armed and dangerous. Enter Move (? For help) End of Game Message: When the game ends due to the conditions display why the game is over.
Courier std medium font. Say the game is over and show the final points. Examples: Say you find a wumpus unarmed. A Wumpus attacks you and makes you his lunch.GAME OVER. You scored 24 Points! Say you find that pit trap: You fall to your death.
Your screams are heard by no one.GAME OVER. You scored 1 whole point! Say you exit out of the dungeon You exit the Wumpus cave and run to town. People buy you ales as you tell the story of your adventure.GAME OVER. You scored 120 points! Notes: I have done what I can to layout the challenge with a very large design requirement. There will be potential for holes or missing elements in the design or things I perhaps did not address in the design.
Please find a suitable solution that fits your desire and implementation and consider this part of the challenge. However if you wish to ask questions about the design or point out obvious things missing from the design, please comment and I can make adjustments. There are lots of strings for feedback or descriptions. Come up with your own or perhaps find a way to do random strings to keep the game fresh and unique.
Add other features or monsters or whatever. This design for the challenge is much like the pirate code - it is just a bunch of guidelines for you to bend to your need and liking. Remember to add Error messages. If you loot an empty cave or move to a direction towards a wall you must display what happens and then either redisplay the whole status or just the prompt for a move. Up to you to decide.
This hard challenges builds on skills learned in doing easy and intermediate challenges. The difficulty comes from following a larger design than normal and putting it all together to make a very fun game. Software. Have fun and enjoy the challenge! Vbscript It is not complete to the specification. It already took quite a lot of time and lines of code, so I am posting it at the state where I ended now. It is essentially a cave exploration simulator, you can explore new rooms, you can find and loot gold or weapons in the rooms. When you return it gives you your score.
However, you will not encounter any traps or wumpus (take it as easy mode). If somebody would like to take this and add more functionality that's fine with me. You can enjoy this game under Windows, save it as wump.vbs and from command line run cscript wump.vbs. Code: 'Cave game, no wumpus n1=10:n=n1+2 'cave size redim a(n.n),e(n.n) 'cave array p=n.n-n-n/2 'player position randomize for i=1 to n.n:a(i)='#':next:a(p)='.' For i=1 to n:e(i)=1:e(n.n+1-i)=1:e(i.n)=1:e(i.n-n+1)=1:next:e(p)=1 do while c'#' then p=p1:if e(p)=0 then s=s+1 e(p1)=1 if i='l' then if a(p)='$' or a(p)='W' then s=s+5:a(p)='.' If i='r' and a(p)='^' then wscript.echo 'score: '&s:exit do loop while i'x' On start it looks like this: ############ #??????????# #??????????# #??????????# #??????????# #??????????# #??????????# #??????????# #??????????# #??????????# #????@?????# ############ Empty room. Your move: (?
For help).
Project 1 - Wumpus World Project #1 Wumpus World Due 9/18/98 Background Lisp is used for a large part in Artificial Intelligence problems. To give you a sense of solving a real problem using Lisp, we will be doing several homeworks relating to the a classic AI problem, the Wumpus World. The Wumpus World problem is a straightforward logical reasoning agent problem. Okay, that's a mouthful.
All that means is that you write an agent, which is formally defined as 'something which perceives and acts,' to reason out the solution to a problem based on some simple information about the world. (Russel, 7) In the Wumpus World, your agent is an intrepid explorer seeking to obtain the treasure in the lair of the large, hairy and smelly Wumpus, who will swallow your agent with one gulp. To make matters slightly worse, there are several bottomless pits strewn about.
Fortunately for the Wumpus, he is too large to fall down these, but unfortunately for you they are quite large enough to engulf your agent's puny body. But never fear, your agent is very observant, and can detect a breeze blowing out of the pits, and can smell the Wumpus from quite far away. And should you meet the Wumpus, you are equipped with your trusty bow and. Well, who needs more than one shot? Formally, the Wumpus world is given as a grid of squares. Each square may contain one of several percepts.
Percepts are simple facts about the square you are in; for example you may sense a breeze. Each square has some subset of the following percepts: (Stench, Breeze, Glitter, Bump, Scream, Death) A Stench means the Wumpus is in an adjoining square (not diagonally).
A Breeze indicates the presence of a pit, simliarly. A Glitter indicates that the current square contains gold. A Bump means you walked into a wall.
A Scream is heard if you successfully kill the Wumpus with your arrow. It takes a long time to die, and you can hear it throughout the cave.
Death means, well, death. There are several actions your agent can take: (Forward, left, right, shoot, grab, climb) Forward means to move one space forward in the direction you are facing. Left means to turn left 90°. Right means turn right 90°. Shoot means to fire your arrow (which proceeds straight in your current direction). Grab means try to pick up treasure (if present).
Climb means to climb out of the cave (if you're at the entrance). Your agent's goal is to reason out where the pits are, where the Wumpus is, so as to get to the treasure without getting killed. A sample Wumpus World is shown in Figure 1. Your Task You have several tasks for this phase of the project.
We will (hopefully) reuse some of our code as we develop our agent throughout the course. Step 1: Develop a reasonable file format to hold a Wumpus World. Your format should support a World of any square size, any number of pits, and at least one Wumpus. The adventurer always starts in square 1,1 the lower left hand corner, so there is no need to store this. Step 2: Write a Lisp function to read in a Wumpus world from a file and return an well-choosen data structure containing the Wumpus world.
Step 3: Write a Lisp function to display the Wumpus world to the user (yes, this is a side effect, but needed). Your display need not be graphic - simple nice text will work. REALLY nice displays may receive extra points. It should, as a parameter, be able to display either the entire world or just the explored world. The percepts for each explored square should be visible.
(Print a key, if needed). Step 4: Write a Lisp function to take an action by the agent and alter the world state accordingly.
Note the distinction between the world state and the agent's knowledge of the world. For example, the world state includes knowledge of the agent's position. This should change if a move is enacted. Note that this function should tell us of the agent's death. Step 5: Write a Lisp program to call the above functions and others to enable the user to play a game of Wumpus World. This should have two modes, debug and normal. In debug mode, the player should be able to see the entire world.
In normal mode, only the explored world should be visible. Grading Functionality: 50% Design Choices: 30% Documentation: 10% Coding: 10% Functionality refers to the question: does the program do what it is supposed to, somehow, someway? Design choices asks the question, does it do what it is supposed to intelligently?
Documentation asks: is the code sufficiently commented? Coding asks: is the program in good Lisp style, i.e. Does it use functional programming and recursion rather than traditional methods? References Russell, Stuart and Norvig, Peter. Artificial Intelligence: A Modern Approach, Prentice Hall, 1995. ISBN 0-13-103805-2.
Page created by Kenneth Flynn.
For Hunt the Wumpus ('wump') Hunt the Wumpus was originally written by in while attending the in 1975. Out of frustration with all the grid-based hunting games he had seen, such as Snark, and, Yob decided to create a map-based game. Hunt the Wumpus was first mentioned in the journal Vol. 1 in September 1973, however the game listing was not published in this issue. The game listing was published in in its October 1975 issue.
This article was later reprinted in the book The Best of Creative Computing, Volume 1. Yob later developed Wumpus 2 and Wumpus 3, which offered more hazards and other cave layouts. By the release of (1975), the game had been to. An implementation of Hunt the Wumpus was typically included with, Microsoft's BASIC interpreter for CP/M and one of the company's first products. Hunt the Wumpus was adapted as an early game for the entitled Twonky, which was distributed in the late 1970s with. A version of the game can still be found as part of the bsdgames package on modern and operating systems, where it is known as 'wump.'
Among the many computers it was ported to is the calculator. The 1980 port of the game for the differs quite a bit from the original while retaining the same concept. It is a graphical rather than text-based game, and uses a equivalent to a rather than an. In this version, the Wumpus is depicted as a large red head with a pair of legs growing out of its sides.
Gameplay. The vertices of a dodecahedron illustrate one common shape of the in the Hunt the Wumpus game. The original version of Hunt the Wumpus uses a text interface.
A player of the game enters commands to move through the rooms or to shoot 'crooked arrows' along a tunnel into one of the adjoining rooms. There are twenty rooms, each connecting to three others, arranged like the vertices of a or the faces of an (which are identical in layout). Hazards include bottomless pits, super bats (which drop the player in a random location, a feature duplicated in later, commercially published, such as, and ), and the Wumpus itself. The Wumpus is described as having sucker feet (to escape the bottomless pits) and being too heavy for a super bat to lift. When the player has deduced from hints which chamber the Wumpus is in without entering the chamber, the player fires an arrow into the Wumpus's chamber to kill it.
The player wins the game if the Wumpus is killed. However, firing the arrow into the wrong chamber startles the Wumpus, which may cause it to move to an adjacent room.
The player loses if he or she is in the same room as the Wumpus (which then eats him or her) or a bottomless pit (which he or she then falls into). Game elements Yob's original program had these features, while later programs differ here. Objects:. Wumpus: your target; a beast that eats you if you ever end up in the same room. Super Bats (2): creatures that instantly carry you to a random room. Pits (2): fatal to you if you enter the room.
Actions: There are two possible actions:. Move: to one of the three rooms connected to your current one. Shoot: fire a 'crooked arrow' a distance of 1-5 rooms; you must name each room it will reach.
Warning messages: Give you information about the contents of adjacent rooms. Wumpus: 'I smell a wumpus'. Bat: 'Bats nearby'.
Pit: 'I feel a draft' Reception and cultural impact. This section is in a list format that may be better presented using. You can help by converting this section to prose, if. Is available. (March 2016). The card game has featured several 'Wumpus' cards. The Wumpus seen on Magic cards is a beast with a characteristically-shaped head, jaw and mane.
Featured Hunted Wumpus (reprinted in several core sets, including ), as well as Thrashing Wumpus., a set concentrating on new takes on popular cards, contained Shivan Wumpus. The Wumpus is also found in the game and the game.
An interpretation of Wumpus called Grand Theft Wumpus is built up gradually in chapter 8 of Land of Lisp. The Wumpus is mentioned in the 'Thy Dungeonman' games in.
The Wumpus gets his revenge on hunters in the audio-only game Be the Wumpus. A zone in inspired by the game was introduced in June 2009. Wumpus is the inspiration behind and project name of Nicholas the Traveler, an evermoving character in., an homage to the original game, was released for iPhone and Palm Pre in 2009. The complex maze structure of Hunt the Wumpus was a direct influence on the random sector link system of., an experimental work by, was heavily inspired by Hunt the Wumpus. was a 1981 LCD handheld game with gameplay influenced by Hunt the Wumpus. Differences were that the rooms were arranged in a 10x10 grid identified like spreadsheet cells like 'A1', and the goal was to find a dragon rather than a wumpus.
uses wumpuses in his book. Treasure of the Wumpus in the Azimuth Cave, a 5.1 surround sound only audio game inspired by the original was created by Jared Bendis and presented at the 2011 & 2012 Ingenuity Festivals in Cleveland, Ohio. In 2012, Hunt the Wumpus was listed on 's All-TIME 100 greatest video games list. Chat application shows Wumpus-themed notices when there is no information.
Retrieved 2018-01-30. The People's Computer Company, founded in October 1971, was a small non-profit group of independent educators who met in a small storefront on Menalto Rd. In during the 1970s. The first issue of their journal, People's Computer Company, was published in October 1972. People's Computer Company. Menlo Park: People's Computer Company.
September 1973. Retrieved 26 January 2018. Retrieved 2018-01-30. Gregory Yob. Retrieved 2018-01-30. Librach, Hank (February 1981). Pp. 230, 232.
Retrieved 18 October 2013. – TI-99/4A Screenshots on. Retrieved 2018-01-30. Retrieved 2018-01-30.
Retrieved 2018-01-30. Retrieved 2018-01-30. 2008-09-05 at the. Retrieved 2018-01-30. Retrieved 2018-01-30. Land of Lisp. Retrieved 2018-01-30.
Retrieved 2018-01-30. Retrieved 2018-01-30. Retrieved 2018-01-30. Retrieved 2018-01-30. Retrieved 2018-01-30.
Grossman, Lev (November 15, 2012). Archived from on November 18, 2012. Retrieved September 20, 2016. Retrieved 2016-03-18. References. (Ed.) (1979), MORE BASIC Computer Games.
New York: Workman Publishing. (2010), Artificial Intelligence A Modern Approach. New Jersey: Pearson Education, Inc.
External links. Gregory Yob's 1975 in Creative Computing. Gregory Yob's 1977 in Creative Computing. Scans of description and BASIC for Hunt the Wumpus.
Scans of description and BASIC source code for Hunt the Wumpus 2.
ASSIGNMENT 10 - Wumpus World: Part 2 In this assignment, you will continue to write the graphical program to implement the Wumpus World game. In the first part you gained experience in multidimensional arrays and in object oriented design and programming. In the second part, you will learn more about object oriented design, and how it all works together.
The assignment posted today is for Part 2. The image at the right is from my coded solution, using Charlie Hand and Zachariah Valenzuela's images from 2015. Each of these images for the rooms is 100x100 pixels. They have graciously allowed us to use their images for this assignment (see bottom of assignment). If you were unable to get your Cave and Room classes to work in the previous assignment, you might want to use mine as a model.
Here are my solutions to the and files. Recall the description of the game from last time.
This has not changed. What has changed is that now you must implement the additional classes that make the game actually run. These are WumpusWorld (the game controller, or the program with the main method in it), and Player, the class that represents the player on the screen. The instructions for Part 1 are included below, but additional instructions and hints for Part 2 are below that. The Wumpus World game takes place in a cave with different rooms in it. You can think of the cave 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 Assignment: 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 develop the code for the Cave and Room classes. As you recall from lecture, even though these are not the classes that will run the eventual game, you can still put main methods in them to test that they are working correctly. You will have to put some thought into what goes into each of these classes, both their instance variables and their methods. You will have completed this part of the assignment if your Cave class can take two integer input parameters and create and draw a valid wumpus world cave. Images have been provided for you that depict 64x64 tiles for rooms in the cave.
You will need to populate your cave with a wumpus, gold and pits, and also determine which rooms are smelly, glittery and/or breezy (they can be all three, and more). When you draw the cave in your test main, you can draw each room according to what it contains.
In the eventual game, these will not show up until the player moves into that room. Because you will all potentially be producing different solutions it is particularly important that you document your code well. In particular, there should be comments for every method that describe what it does, what it expects for input parameters, and what it returns, if anything.
Some things that may help you in drawing the cave: 1. Since the images are 100x100 pixels, you probably want to set your canvas size so that it has rows.PIXELS and columns.PIXELS as its dimensions. Similarly, you will want to set the X and Y scale of your canvas to run from 0 to rows.PIXELS and from 0 to columns.PIXELS to make it easier to place images. When placing an image, remember that the x and y coordinates that you give are where the image will be centered.
If you place the image at, say map location 0,0 only the upper right quadrant of the image will show on the canvas. You will want to use for the image drawing routines. Part 2: The second part of this assignment is to write the rest of the code to implement the Wumpus World game. Don't be surprised if, as you write code for the second part, you find places where you need to change the previous code. It's often difficult to think through the problem in enough detail to think of everything as you design the solution.
The player always starts in position 0,0 (the lower left corner) of the cave. This space is guaranteed to be safe (no pits and no wumpus) but there may be a breeze or stench in that room. If you're really lucky, the gold could be there also. The only rooms that are actually displayed are those that the player has visited - the rooms not yet explored must show up as blank spaces. The player moves by using the 'w', 'a', 's', and 'd' keys for up, left, down and right respectively. Your program should redraw the player on the screen if it makes a legal move, and it should check to make sure that the player does not move off the screen. If the player wishes to shoot the arrow, the 'i', 'j', 'k', and 'l' keys are used to shoot up, left, down and right respectively.
If the wumpus is in line with the direction the arrow is shot, even if he is several squares away, he will die. Your program needs to handle removing the wumpus and stench from the cave if that happens. Finally, the key 'g' is used to grab the gold if the player is in the same room with it. Your program should react appropriately if the player falls into a pit, is eaten by the wumpus, or grabs the gold.
Any one of these signals the end of the game. Images for the game. Sounds for the game: (if you choose to add sounds - you can also find and use your own sounds if you like - you will need to use for this) Grading: Grade Item Wumpus World II Points Earned Program Compiles. 4 Submission. Submit your Java files for WumpusWorld.java, Player.java, Cave.java and Room.java to Moodle, under Assignment 10.
If you are working as a pair, only submit one set of files, but make sure both names are on the files. Extra Credit. A couple of ideas for extra credit on this assignment are to add sound (using StdAudio.java) to some of the events in the game. Another idea is to add multiple wumpuses (wumpii?) to the game.
Or to add 'bats' that randomly pick up the wumpus, the player or the gold and move them to random locations. Or, you could allow the wumpus to move also. If you choose to do any of these, submit your regular assignment to the normal Moodle dropbox, but submit your extra credit version, with all necessary files, to the Extra Credit dropbox at the top of the Moodle page. Page last updated: November 15, 2017.