Logo Lesson 2
This lesson should see students introduced to the benefits of iteration within programming. Here they will be introduced to the ‘Repeat’ loop in Logo to draw a range of shapes quickly.
The lesson outline is in the presentation below:
Objective
To understand the benefit of using loops in programming.
Lesson content
Students are shown a loop that will draw a square using far less code than was used in the previous lesson. They apply the principle to draw shapes of their own. Once these initial tasks have been completed, students should explore their use of the Repeat loop. For example:
- Can they draw a hexagon using the Repeat tool?
- Can they draw a simple house using the Repeat tool several times and as few lines of code as possible?
Answers
Possible answers for the two tasks suggested on the last slide are provided below:
Hexagon:
- repeat 6 [fd 100 rt 60]
House (very basic version – students might be able to add a lot more):
- repeat 4 [lt 90 fd 100] lt 30 repeat 3 [fd 100 lt 120]