If, if, if ...
Wait a minute! Reeborg can decide make some decisions on his own. Didn't I tell you?
Well, to tell the truth, Reeborg does need some help to decide: you have to give him some choices to decide between. For example, when Reeborg is next to a beeper, you can give him some choices as to what to do; for example, you can ask him to pick it up as follows
if next_to_a_beeper():
pick_beeper()
Let's look at the meaning of the above code:
and we want the final position to be:

So, we want to ask Reeborg to:
def move_and_pick():
move()
if next_to_a_beeper():
pick_beeper()
repeat(move_and_pick, 9)
turn_off()
Try it!
It's harvest time, yet again! However, this time not all seeds have sprouted and some carrots are missing. Have Reeborg pick up all the carrots (represented by beepers) in this garden. The world file is harvest3.wld. Look back at the second last harvesting exercise that you did last chapter; chances are, all that you need to do is change the instruction harvest_one_row() so that it looks similar to the above move_and_pick() instruction.

Note that your new program should also work as is with the world file harvest1.wld that we had used before. Try it!
Avoiding repetitions, again!
-
-
Listen to me ... or else ....