Repeat it! Loops
Paint shapes on a grid with a few commands inside a "repeat" block, and do a dance loop at home. Loops let a short program do a big job.
- Computational thinking
- Problem solving
- Creativity
🔁 Say it once, do it many times
Imagine telling a robot “step forward” 100 times. Boring! Programmers write it once and say repeat 100 times. That’s a loop. Loops are everywhere: a washing machine spins round and round, a clock ticks every second, a game checks your buttons again and again.
🎮 Try it on the screen
Put a few commands inside the repeat block, pick how many times to repeat, and press Run. Can you paint the target shape with as few blocks as possible?
Challenge 1: A long line
🔁 Repeat times:
Blocks you wrote: 1 · Steps the computer does: 0
Paint the yellow squares, starting at the red dot facing right. Hint: One step, repeated 7 times.
🛠️ Make a dance loop
- Make up a short dance of 3 or 4 moves, like clap, stamp, spin, jump.
- Write it as a program on paper: draw each move in a box, and draw a big bracket round them with “repeat 4 times”.
- Ask your family to follow the program. Everyone dances the same!
- Now nest a loop: inside the dance, add “clap 3 times”. A loop inside a loop!
- Put music on and run your program.
💡 What happened?
A loop is a short way to write lots of repeated steps. Your painting programs might have only 3 or 4 blocks, but the robot ran many more steps. Programmers love loops because they make programs shorter, easier to read and easier to fix. Change one block inside the loop and every repeat changes too.
Did it work?