Robby Project 12


Robby now has seven abilities:

turnLeft()

turnRight()

move()

pickFruit()

dropFruit()

hasFruitLeft()   

This method returns true if Robby has at least 1 piece of fruit; false otherwise.

alreadyFruitHere()  

This method returns true if there is at least 1 piece of fruit on the graph where Robby is standing; false otherwise.

Project 12:  There is a mystery stack of fruit somewhere on the graph.  The stack is at x = 8.  We also know that the y-coordinate of the stack is a positive number.  Robby starts at (0, 0) facing East.  

You have one objective: 

1) Give Robby directions to find the stack of fruit and pick up the pieces on the stack, then he should return all the pieces of fruit to the origin (0, 0).

For example, there may be 17 pieces of fruit at location (8, 5).  You would need to provide the directions to pick up all 17 pieces of fruit and drop the 17 pieces at (0, 0).

Your instructions should work for any scenario described above as the number of fruit and the y-coordinate vary randomly. 

Note: If your code works for 5 test cases in a row, you can enter your e-mail address.