Step 5 - Multiple Nested Loops
This level can be solved using two sets of nested loops. Again, let’s be as efficient as possible. We’ll see if we can get the chicken to the coin while using the fewest instructions possible.
> Open Level 5.

> Think carefully about the most efficient movements and repeats we can use to get the chicken to all the coins.

> Edit the script on the chicken and use "When the level starts", "broadcast message", and "repeat 10 times".
The first repeated set of movements is to make the chicken move up twice.
> Change "message" to “up” and change “10” to “2”.
Then the chicken needs to move right 4 times.
> Duplicate "repeat 2 times", and drag the duplicate underneath the original. Change “2” to “4”, and change “up” to “right”.

Now you need to repeat this set of repeated movements. The chicken should move this way twice.
> Grab "repeat 10 times" from Control Flow, and drag it above the first repeat block.
> Drag the bottom two repeat blocks inside the first repeat block, and change "10" to “2”.

That’s the first repeated set of movements done. Now to make the chicken move up twice and left three times.
> Duplicate "repeat 4 times, broadcast right", and drag these blocks to the very bottom. Change “4” to “2”, and “right” to “up”.

> Duplicate this new "repeat" block, and change the duplicated “2” to “3”, and change “up” to “left”

Then finally make it so these two new repeat blocks are themselves repeated twice.
>Grab another "repeat 10t times" block (from Control Flow), and drag it under the first repeat block. Set it to repeat 2 times, and drag the bottom two repeat blocks inside it.

> Click Play once you're confident that you've solved the level.
Did the chicken reach all the coins? Great! Let’s continue to the next step.
If not, have a look back over your Script and see if you can spot the bugs.