Levels 1 to 5 of Blockly Maze introduced you to the Blockly environment, and to the way blocks snap together. Levels 3, 4 and 5 introduced loops: the green block that repeats everything inside it until a certain condition (arriving at the red pin) is met. The image below shows an example of you can use the green block.
In programming terminology, the ‘repeat until’ block is a type of control structure: something that controls the flow through the program. You’ll have seen this flow as the individual blocks light up when the program is run. Control structures check to see if a condition is met, and depending on the outcome, affect what code in the program is run next.
Levels 6 to 9 will introduce two new control structures: the ‘if’ statement and the ‘if-else’ statement. These are represented by blue blocks as show in the image below.
Blockly will explain how to operate the blue blocks to you. You may need to change the ‘condition’ shown in the blue blocks in order to solve the problems.
Return to Blockly Maze, and work through Levels 6 to 9. As you work through them, pay careful attention to the flow of logic through your program.