Assignment 4 - Hunt the WumpusDue by 11:59pm on Monday, 3/4/2018Demos due by 11:59pm on Monday 3/18/2018The goal of this assignment is to start working with polymorphism and C++ templateclasses from the STL. Follow the directions below, and make sure your source code files (noexecutable files, .o files, or other crufty stuff) are committed and pushed back into yourrepository on GitHub to earn credit for the assignment.The Hunt the Wumpus gameHunt the Wumpus is a game set inside the cave of the Wumpus, a scary, gold-hardingmonster who likes to eat people who disturb its sleep. The players goal is to guide anadventurer to kill the Wumpus, find its hidden gold, and escape alive. The Wumpus lives in alarge cave of rooms arranged in a grid, where each room at has four tunnels leading to therooms to the north, east, south, and west.The adventurer starts the game in a random empty room in the Wumpus’ cave. Her startingposition is also the location of the escape rope that she must use to escape after shescompleted her task.Each room may be empty, or it may contain one (and only one) of four events (alldescribed below): two kinds of dangerous hazards, the terrifying Wumpus, and the goldtreasure. When the adventurer is in a room that’s adjacent to one containing an event, theplayer will receive a percept (a message) to inform them about the event the adventurer isclose to.If the adventurer perishes while searching for the Wumpus, the player should be presentedwith the option to start the game over with the same cave configuration, start the gameover with a new random cave configuration, or quit the game entirely.The player wins the game if they can safely guide the adventurer through the cave to kill theWumpus, pick up the gold, and make it back to the escape rope unharmed!Game elementsThe adventurerEach turn you may take one of two actions to guide the adventurer:Move: You can move through a tunnel to an adjacent room.Fire an Arrow: The adventurer begins the game with three arrows. As long as theadventurer still has at least one arrow, the player can choose to fire one in any direction (i.e.north, south, east, or west). The arrow continues flying in the same direction until it hits awall or travels through three rooms. If the arrow enters the Wumpus’ room, it pierces the Wumpus’ heart and kills the monster. If the adventurer runs out of arrows without havingkilled the Wumpus, you lose.The WumpusUsually, the Wumpus is peacefully asleep in its cave. Two things wake the Wumpus up,however: the adventurer entering its room or shooting an arrow and missing it. If theWumpus wakes up while in the same room as the adventurer, the Wumpus will angrily eatthe adventurer, ending the game. If the Wumpus just wakes up from hearing an arrowbeing fired, though, there’s a 75% chance it will move to a random empty room in the caveto avoid being found.HazardsThere are two kinds of hazards in the Wumpus cave:Bottomless pits: Two of the caves rooms have bottomless pits in them. If the adventurerenters a room with a bottomless pit, she falls in and dies, and the player loses.Super bats: Two rooms have super bats. If the adventurer enters a room that contains superbats, an angry bat grabs her and takes her to some other room at random (which could bedangerous!).The goldThe gold is a treasure sitting in a room that contains neither a hazard nor the wumpus. Ifthe adventurer is in a room containing the gold, she automatically picks it up and takes itwith her.PerceptsWhen the adventurer is in a room directly adjacent to to a room containing an event, theplayer receives the following messages:Wumpus: You smell a terrible stench.Super bats: You hear wings flapping.Bottomless pit: You feel a breeze.Gold: You see a glimmer nearby.Notice that there’s no percept for the escape rope! That means the player will have toremember where they started and find their way back to that tile after they’ve completedtheir task.As an example of how the percepts work, if the adventurer is standing in an empty roomwith the Wumpus one room to the North, the Gold one room to the East, and Bats tworooms to the South, they would receive the following messages at the beginning of theirturn:You smell a terrible stench.You see a glimmer nearby.Remember, the percepts don’t tell you where the hazard or gold is, just that it’s somewhereclose!Program requirementsYour program should allow the user to play Hunt the Wumpus, as described above.The Wumpus cave is represented by a square grid. The size of the grid (i.e. the number ofrooms on one side of the square) should be specified as a command line parameter toyour program. Caves smaller than four rooms on a side arent allowed. You should visualizethe grid to allow the user to play the game. In particular, you should display the grid, andindicate within the grid which room the player is in. An example visualization of a 4x4 gridmight look like this, where the * character represents the location of the adventurer:Your code must have the following classes: Room, Event, Wumpus, Bats, Pit, and Gold. Youmay create more classes if they would be helpful.The Event class must be abstract (i.e. it must contain purely virtual functions), and theWumpus, Bats, Pit, and Gold classes should all be derived from Event. Remember, any eventdoes something when the adventurer enters the same room as the event, and will display amessage when the adventurer is nearby. Your design of the Event class should reflect this.For example, your Event class might have a percept() method that is called whenever theadventurer is in a room adjacent to the event, where the Wumpus, Bats, Pit, and Goldclasses implement their own specific versions of the percept() method. Similarly, your Eventclass might have an encounter() method that is called when the adventurer enters the sameroom as the event, with the individual event classes implementing their own specific versions of encounter().You must use the Event classes polymorphically. In other words, your Room class mayonly contain a member of the Event class but not members of the Wumpus, Bats, Pit, orGold classes.Each Room contains at most one Event, but it may not contain any Event. The design ofyour Room class should reflect this.The grid representing your cave should be implemented using the std::vector class.HintsPolymorphism only works when you are working with references or pointers. If you use thevalue of an object directly, it may not select the correct member function.Hunt the Wumpus is a game all about hiding information from the player, which mightmake it hard to debug! To get around this problem, you might want to create a debuggingonlymap display so that you can tell exactly what’s in the cave while you’re testing yourprogram. Just make sure you disable this before submitting the assignment!Hunt the Wumpus is a very common introductory programming project. This assignment,however, is designed to specifically include the programming concepts you’ve seen in thisclass so far. It’s very likely that other versions of Hunt the Wumpus you could find do notcorrectly implement what’s described above.Extra creditFor 10 points of extra credit, you can implement an AI class that plays the game for you.This AI class should use the same interface to the game that the player does. That is, itshould use percepts to learn about the world and make decisions.Code styleYou must include a header comment for each source code file that contains a description ofthe file (including how to run the program, command line arguments, etc. if the file containsyour main() function), your name, and the date. Your code should be well commented,including header comments for all functions describing what the function does, itsparameters, and any pre- and post-conditions for the function. You should appropriatelyuse whitespace, newlines, and indentation.Make sure you review the style guidelines for the course, and start trying to follow them:http://web.engr.oregonstate.edu/~hessro/static/media/cs162-styleguidelines.4812c1d9.pdfSubmitting your programTo submit your program, you need to make sure the following files are committed into yourgit repository and pushed to your master branch on GitHub before the due date above:The .cpp file containing your application code.All of the .hpp and .cpp files containing the interface and implementation of your classes.Your Makefile.Do not commit any other files (other than the ones that were already in your repository atthe start of the assignment). A good way to check whether your assignment is submitted isto simply look at your repo on GitHub (i.e. https://github.com/OSU-CS162-W19/assignment-4-YourGitHubUsername). If your files appear there before the deadline,they they are submitted.Grading criteriaYour program MUST compile and run on flip.engr.oregonstate.edu, so make sure you havetested your work there before you make your final submission, since a program thatcompiles and runs in one environment may not compile and run in another. Assignmentsthat do not compile on flip will receive a grade of 0. If you do not have an ENGRaccount, you can create one at https://teach.engr.oregonstate.edu/.This assignment is worth 100 points total:90 points: your program meets the specifications above10 points: displays a square cave whose size is set by a command line parameter10 points: implements Room class20 points: implements abstract Event class and derived Wumpus, Bats, Pit, and Gold classes10 points: uses Event classes polymorphically10 points: uses std::vector to implement a grid of Room objects10 points: allows the player to move the adventurer through the cave and to shoot up to 3arrows5 points: the Wumpus is killed if hit by an arrow and moves to a different room with 75%probability if woken up by an arrow that misses5 points: adventurer dies if she falls in a pit and is carried to a different room if sheencounters bats5 points: game displays percepts based on adjacent events5 points: adventurer wins by picking up gold, killing the Wumpus, and escaping10 points: your code is appropriately commented and uses consistent and appropriate styleYour work on this assignment will be graded by demoing it with a TA. During your demo,you will compile and run your program for the TA and walk them through your source code,describing to them how it works. Itll be your responsibility to sign up for a 10-minute demoslot with a TA by the demo due date above. You will receive a zero on the assignment if youdont demo it with a TA by the demo due date.本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp