Session 2
Using repeat with a condition on a simple route: repeat until
Objectives
Understand how to use a conditional repeat — repeat until at destination
Resources | Vocabulary |
---|---|
• Levels 29 to 32 in Rapid Router • Resource sheets 1 and 2 • Video 'Ana discusses repeat until and repeat while' • Interactive Whiteboard (IWB) | • Repeat until |
Let's get started
Introduce level 29 [fig S2.1] of the app on the IWB.
Ask the students what they think repeat until will do. Point out the at destination block.
Ask a volunteer to test this out with a simple forward route.
Do this again with a simple repetition of turn left and turn right.
Look at the video to see Ana talking about her work and how repeat until is useful.
Mini review
Ask the students to discuss with a partner the difference between using repeat until at destination, instead of repeat a number of times.
Set out two straight ‘roads’ in the classroom (you can do this with masking tape, construction blocks or even by creating a route with the classroom tables) and ask two students to be van drivers at the start of each. Ask them to ‘act out’ the code. Will they both get to their destinations even if one route is longer? Why?
Practical
Students try out the other challenges at levels 29 to 32 [fig S2.2].
Share and review
Share what has been learnt in this lesson.
Can you draw two routes where repeat until at destination (forward, left, right) would work using KS3–S2–1? [fig S2.3].
Students discuss the unplugged activity in pairs.
Choose a pair to add the repeat until at destination blocks of code to your code wall, and add labels to explain what they do.
Can you think of some activities which we do in the classroom, where we use repeat until?
For example:
Filling a large container with smaller beakers of water — ‘repeat until container is full’;
Playing the percussion to a music track — ‘repeat until the song is finished (tap the drum, wait 1 second)’.
Further consolidation
Use resource sheet KS3–S2–2 [fig S2.4] for students to create their own repeat until loops.
Last updated