Recap on using a simple repeat loop
- Apply the movement instructions and repeat loops to create a program
- Debug the program
- Create a challenge for a partner which involves a repeat loop
Note that you may wish to do the practical element in groups, as each child needs a computer in this session. You will also need to have shown the students how to log in to the app, using the account details you have created by setting up your class.
If this is the first time the class has used the app, explain that the turning movements turn right and turn left have a different meaning from the ‘right’ and left’ rotational turn that students may have used with floor robots and Logo-type turtle graphics programming languages.
In the app, turn right means go around the corner in the road from one grid line to the adjacent line on the right [fig S1.1].
fig S1.1 - right and left
Ask the students to work out what the turn right and turn left commands do. You may wish to give the students time to explore levels 1–18 before you start (depending on your student’s previous experience).
fig S1.2 Level 21
Use the level 21 challenge [fig S1.2] with a repeated pattern displayed on a large screen or IWB with a sheet between two on the tables.
Highlight the blocks of code that are available for them to use (move forwards, turn right, turn left, repeat). Provide laminated Blockly cards on the tables for students to sequence physically if they need to [fig S1.3].
Ask the students, in pairs, to discuss what instructions they will need and write these on their whiteboards. Discuss their suggestions and ask one pair to key in their program. Debug together if needed, to arrive at this repeat loop:
1. Practice run
Students try some of the levels 19-23 individually As routes become more complex, pupils may find it difficult to create solutions using loops. To help them here, demonstrate a harder level by creating a solution entirely without loops and then looking for a pattern to repeat. E.g. levels 23 and 24 are good candidates for this.
Explain that they have a short time to create a route for a partner to code, where they will need to use a repeat instruction in their programming. It could be a simple repeat 3 (move forwards).
fig S1.4 - Level 22
Show level 22 [fig S1.4] as an illustration. Use Resource Sheet 1 to help them plan. They must then save the route, and test the program themselves to make sure it works.
They could take a screenshot and save this to their portfolio/learning record.
2. Try out each other’s challenge
Change places and try to code your partner’s route (you may prefer to do this in a follow-up session if time is short)
See unplugged activity for gifted and talented pupils in Intermediate Session 3, involving nested repeat loops.
Students can also practice using a simple repeat loop in levels 24 to 28.
S1.5 - Level 26
Display two sequences of code next to level 26 [fig S1.5] labelled 1 and 2.
One sequence is a solution and one is not.
Ask the students to discuss in pairs and write the correct solution on their whiteboards.
Can you explain how the code works?
Is this the shortest possible code sequence?
This is the correct solution: