Tutorials index

Blockly Maze Tasks


Example 1 - Using loops
When solving longer mazes, it is often best to look for areas of the maze that require the same block to be used again and again. In the maze shown below the robot has to go forward 7 times in a row, do some more stuff and then go forward 7 times in a row. We can use loops to speed up the code writing process.

Two types of loops are provided:

In the maze below, the number of blocks you are allowed to use is limited to 12, so we cannot solve this without using loops. Note how the Repeat do loop is not much use to us here!

Try to get the robot to the green square in this simple maze:

Try this out in a new window ...

<< Back | Next >>


Maze Tutorial Start
Example 1 - Using loops
Example 2 - Using using if blocks

Tutorials index



Did you know the UK Bebras Challenge is run by the Raspberry Pi Foundation? Discover free teaching resources, tools, and expert support for computing education at raspberrypi.org.