Copyright © University of Cambridge. All rights reserved.

'LOGO Challenge 6 - Triangles and Stars' printed from https://nrich.maths.org/

Show menu

How about starting by creating procedures for the small and large triangles?

to smtri
REPEAT 3 [FD 20 RT 120]
end

to lgtri
REPEAT 3 [FD 100 RT 120]
end

Then you might create a procedure for the part of the patternmade from the large triangles:

to star
LT 30 REPEAT 6 [lgtri RT 150 PU FD 20 PD LT 90]
end

What is the "LT 30" for at the start of this procedure?
What is happening between each triangle being drawn?

Now you could produce the part of the design created from the small triangles.
Finally, put the two patterns together.

Of course there are other ways of doing this. You could create a procedure comprising the basic unit of one large and two small triangles and then repeat this six times.

The main point is that working on small 'modules' at a time means you can test things out before moving on. It also helps you to think about how the problem can be tackled by considering smaller tasks to complete.

If you have time:
Think carefully about the procedure below. It involves a technique called recursion and builds up a particular pleasing pattern of squares. There are many later LOGO Challenges that introduce and develop this idea further:


TO SQUARE :SIDE :B
IF :SIDE < :B [STOP]
REPEAT 4 [FD :SIDE SQUARE :SIDE/2 :B LT 90]
END


Try SQUARE 60 6 or SQUARE 60 2 or......