The aim

Use the commands below to pick up all of the fruit and put them into the correct boxes. Once all the fruit is in a box, you have won!

Commands

CommandFoobot action
ahead(n)Move forwards n squares
back(n)Move backwards n squares
left(n)Turn left 90 degrees n times
right(n)Turn right 90 degrees n times
lift()Lift a fruit if it is in front of foobot
drop()Drop a fruit that foobot is carrying
peek()This function returns a letter corresponding to the fruit that Foobot is currently facing. "a" for apple, "b" for banana etc. and "" if there is no fruit

An example

Foobot needs to:

  1. go ahead one square to the banana
  2. pick up the banana
  3. turn right
  4. go ahead one square
  5. drop the banana in the box

The code would look like this:

                ahead(); 
                lift(); 
                right(); 
                ahead(); 
                drop();