This assignment is adapted from an assignment created by Henry M. Walker. Source
The purpose of this assignment is to learn to
The robot has a few methods it can use. You can use these by calling them on the variable called "robot".
These methods can be found in the Robot file, but for reference they are:
getxLoc(), which returns the X location of the robot (how far from the left side of the screen it is)
getyLoc(), which returns the Y location of the robot (how far from the top of the screen it is)
moveUp(), moveDown(), moveRight(), moveLeft(), and stop(), which make the robot do those respective actions.
You can get the location of the goal by calling getxLoc() and getyLoc() on the "goal" variable.
Finally, to get the locations of obstacles (on levels 1 or 2), you can check the 2D array in level.obstacleLocations[y][x].
A value of true indicates that there is an obstacle there, a value of false indicates that there isn't.
You have access to where all the obstacles are on the board, where the Goal's location is, and the methods listed above. Call the robot's methods in order for it to reach the goal. If the robots location contains an obstacle after moving, then the robot loses.