Session 2
Introducing the repeat code
Objectives
Understand and use simple repetition
Resources | Vocabulary |
---|---|
• Levels 19 to 22 in Rapid Router • Video 3 • Screen shots of levels 20 to 22 from the Levels Guide • Resource sheets • Interactive Whiteboard (IWB) | • Repeat, repetition |
Let’s get started
Show Video 3 [fig S2.1] to introduce the idea of a repeat function, which demonstrates how this is important in programming in the wider world.
Bring the students together and show them level 19 [fig S2.2], where a repeat command would be useful.
Ask them to write out the instructions they would use to have the least amount of code possible.
Go through the process together on the IWB.
Can you see a pattern in the instructions?
Discuss what they see. If we explained this in English we might use words like ‘over again’.
Explain that programming language has a word for this: repeat.
Introduce the repeat command in the app.
Demonstrate how to use this by dragging it across, clicking on the number to choose the times to repeat, and dragging the move blocks into the repeat loop. |
Look at level 20 [fig S2.3], and go through the process of showing the code step–by–step, seeing the pattern and shortening the code to a repeat loop.
Unplugged activity
Talk about what things we repeat in other areas of learning.
Start a clapping rhythm and ask the students to repeat it three times. Think of some poems where lines are repeated.
Independent activity
Most students will be ready to refine their programs by using the repeat loops in levels 19–21. Some may go on to try level 22, which is covered in Session 3. For levels 20–21, some students will benefit from building the code step–by–step. Spotting the pattern, separating out the set of instructions to be repeated using the repeat block around that set, and placing the superfluous code in the workspace bin. Have printed copies available of levels 20–21 for the students to mark repeated sections.
Support
Some students may need to walk through the repeat sequence. You can do this by making a repeat pattern path on the floor with masking tape, and asking the students to work out the algorithm using forward and turn instructions.
Share and review
Discuss what they have learnt.
Can you explain why it is useful to have a block for repeat?
Look at level 22 [fig S2.4] together. If any students have tackled this, ask them to explain to the class how they approached it, and say that you will start with this next lesson.
Recap on the programming commands they have learnt so far and add repeat to your code wall display. Use resource sheets 1 and 3 for homework / consolidation.
Last updated