How would you return a value from a method and using it for an if-then statement?
For example, I have my robot, and I want him to count the numbers of beepers in a pile using:
then if there is:Code:
public int numOfBeepersInPile()
- 1 beeper in the pile, turn left
- 2 beepers in pile, turn around
- three beepers, turn right
How would I take the value of "numOfBeepersInPile" and apply an if-else statement to it?