Wumpus World RobotProgram | Fall 2014
The Wumpus World is a grid of 4x4 squares, containing a wumpus, a pile of gold, and any number of bottomless pits. Each of these items take up one full square on the grid. No square can have two items, but some squares will have none of these items. None of the items move. The "explorer," in this case a robot, will start at the bottom left-hand corner of the grid and attempt to retrieve the gold and return to its starting square. The explorer has a single arrow that is able to kill the wumpus, which would allow the explorer to pass safely through the wumpus's square. If the explorer goes into a square with a pit, or walks into the wumpus's square without shooting it, the explorer dies. The explorer cannot see a top-down version of the map. Instead, the explorer only gets information about the squares adjacent to it, but without having any information about where this information was coming from. For example, on the board to the right, if the explorer goes to space C3, they would hear wind coming from a pit and smell the Wumpus, but they would not know which direction the pit or Wumpus is from their location. I completed the Wumpus World Challenge as part of a team. My role in the team was to create an algorithm to solve this problem for any solvable board, as well as convert this algorithm to C code. My teammates' job was to create a robot that could run the code I created and solve the problem on a physical board. The code attached is written nearly entirely by me. The only parts that I did not write were the functions for moving the robot, which were done by my teammates so that our robot could complete the physical challenge. Our robot was successful and was able to complete every single board presented to us, without ever having to make any risky guesses. |
wumpus.c | |
File Size: | 18 kb |
File Type: | c |