1 What we already know
Before we combine shapes, let’s remind ourselves what each piece of code does:
for i in range(n):repeats the lines underneath it n times.t.forward(steps)moves the turtle forward and draws a line.t.right(degrees)turns the turtle.t.penup()lifts the pen — moving the turtle now won’t draw anything.t.pendown()puts the pen back down so the turtle draws again.
Today we’ll put a loop-drawn shape down, lift the pen, move across, put the pen down again, and draw another loop-drawn shape — so we can build pictures with several shapes side by side.
2 Two triangles side by side
Here’s one triangle drawn with a loop, then the turtle lifts its pen, moves across, and draws a second triangle.
Try it:
Find the line t.forward(120) between the two triangles.
Change it to t.forward(200).
Click Run. What happens to the gap between the triangles?
3 Two squares side by side
Same idea, but with squares this time.
Both squares use exactly the same loop code.
Only one line of code decides where the second square appears.
Which line is it?
4 Now you try: three shapes in a row
Use loops to draw three shapes next to each other — you choose which shapes. The pattern is started for you below.
Hint:
Copy a loop from an earlier lesson for each shape.
Remember t.penup() before moving, and t.pendown() before drawing again.
5 Design a scene
Use loops to draw several shapes side by side and build your own picture — a row of trees, a fence, a pattern, anything you like.
What you learned in this lesson
- a loop-drawn shape can be placed anywhere by moving the turtle with
penup()first t.pendown()puts the pen back down so the next shape draws properly- the same loop code can be reused for every shape — only the movement between shapes changes
- several loop-drawn shapes placed side by side can build a bigger picture
