Lesson 6: Loop On
Challenge focus: 26 - 30
Coding Concepts: The syntax of the simple times loop
Coding Adventure Part I
Key stage II
Class IV
Lesson Overview
Challenge Range | Coding Concepts | Sub Concepts | Resources |
26 - 30 | Loops |
| Lesson Plan 27 |
Coding Adventure Part I
Key stage II
Class IV
Lesson Objectives
Coding Adventure Part I
Key stage II
Class IV
The syntax to define simple times loop
where :
1 | n.times-> #loop header |
2 | ………..#Your code here #loop body |
indentation
Coding Adventure Part I
Key stage II
Class IV
The importance of the indentation
Coding Adventure Part I
Key stage II
Class IV
Demo 1
Write a code to collect all the bananas for the given challenge 26.
Coding Adventure Part I
Key stage II
Class IV
Demo 1 Solution
Loop body
Indentation
Loop repeats 3 times
Coding Adventure Part I
Key stage II
Class IV
Activity 1
Identify the bugs in the code given right side and rewrite the code to collect the bananas (unplugged activity).
Coding Adventure Part I
Key stage II
Class IV
Activity 1 Solution
No indentation
Used wrong function
1 | #solution |
2 | 4.times-> |
3 | step 10 |
4 | step -10 |
5 | turn right |
Coding Adventure Part I
Key stage II
Class IV
Activity 2
Coding Adventure Part I
Key stage II
Class IV
Activity 2 solution
28
Coding Adventure Part I
Key stage II
Class IV
Activity 2 Solution
29
Coding Adventure Part I
Key stage II
Class IV
Activity 2 Solution
30
Coding Adventure Part I
Key stage II
Class IV
Key Points
Coding Adventure Part I
Key stage II
Class IV