I have been given the task of writing a segment of code using the becker.robots
package and I must create a method called pickUpThings
for a class which has a parameter for the number of Things
to be picked up
ie
public void pickUpThings(int thingsToBePickedUp)
I have figured out that i must create a segment of code which lets me use a while loop (i think)
while(this.countThingsInBackpack() < thingsToBePickedUp)
{
//...
}
Assumptions:
- There will be either 0 or 1 things on each intersection.
- Enough 'things' will be laid out in front of the robot.
Also, the robot travels on the same intersection i.e. heading east for the entire coded procedure.