Exercise 7: Cleaning the garden

Cleaning the garden

This lawn needs a good mowing!

GBB/1.0 size 3 3 cell 0 1 Verde 1 cell 1 2 Verde 1 cell 0 0 Verde 1 cell 2 1 Verde 1 cell 0 2 Verde 1 cell 2 0 Verde 1 cell 2 2 Verde 1 cell 1 0 Verde 1 head 0 0 Willie

In spite of not knowing why Willie thinks that our board is a garden, we prefer to pay attention to him. We don´t want to take the risk of having to listen to him talking about scotch feats.

With the head in the origin, write a program being in charge of “mowing” the board from the image: grab every green stone. Once it is done, the head must finish where it started.

You must sign in before submitting your solutions

Oops, your solution didn't work

  • Check that your program does not have recursion or an infinite loop
  • Check that you have an internet connection
  • Wait a while and try again

We are processing you solution

Please press F5 if results are not displayed after a few seconds