Star Student Builder logoStar Student Builder
← Block Builders Lesson 3Std 3-5

A Loop Inside a Loop

Here is where drawings start to look like real art. Draw one shape with a loop. Then put that whole loop inside another loop that turns a little each time. Rangoli patterns work in exactly this way.

πŸ’‘ The idea

Putting one loop inside another turns a simple shape into a pattern.

  • The inside loop draws one shape. The outside loop repeats and turns it.
  • The turns of the outside loop should also add up to 360.
  • Six turns of 60 make a six-part pattern. Eight turns of 45 make eight parts.
  • The inside shape must finish where it started, or the pattern drifts away.
  • Everything inside the outer brackets happens once per round.

πŸ“˜ Words to know

nested loop
a loop written inside another loop
pattern
a shape repeated in a regular way
rangoli
a floor pattern drawn around a centre point

πŸ‘€ Watch this

Six squares turned around one point, like a rangoli drawn on the floor.

colour purple
repeat 6 [ repeat 4 [ forward 70 right 90 ] right 60 ]
What this program draws
What it draws

✍️ Your turn

  1. Run it and count the squares.
  2. Change the outer repeat 6 and right 60 to repeat 12 and right 30.
  3. Change the inside square into a triangle: repeat 3 [ forward 70 right 120 ].
  4. Try colour rainbow instead of purple.
  5. Make the shape smaller and the pattern bigger.

🎯 Challenge: Make a rangoli from eight triangles turned all the way around the centre.

Show me one answer
colour orange
repeat 8 [ repeat 3 [ forward 80 right 120 ] right 45 ]

Your program
Ask GuruAcharya Samayeshwar