UK Bebras


OUCC Tutorials: blockly maze [3 of 3]

Tutorials index

Blockly Maze Tasks

Example 2 - Using if blocks
The infinite or Repeat do loop block comes into its own when it is combined with some decision blocks.

Now we can wrap our code in a Repeat do block and ask the robot to make decisions: We can send the robot forwards unless it discovers it can turn left. If it can turn left, it should do and then go forward again.

See if you can use this algorithm to get the robot to the green square in the maze below.
(You are still allowed to use no more than 12 blocks.)

<< Back

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

Tutorials index