Loops in Scratch
A loop in Scratch is a block that repeats an action again and again, so your child does not have to stack the same instruction over and over. The two main loops are the repeat block, which does something a set number of times, and the forever block, which keeps going until the project stops. Loops are one of the first "aha" moments in coding, and this guide explains them in the simplest possible way.
Why Loops Matter
Imagine your child wants the cat to take ten steps. They could drag ten separate "move 10 steps" blocks and stack them up. It would work, but it is slow and messy.
A loop solves this beautifully. Instead of ten blocks, your child uses one repeat block set to ten, with a single move block tucked inside it. Same result, far less effort. The idea your child is learning here is precious: let the computer do the repeating. This is one of the core ideas behind all programming.
The Repeat Block
The repeat block lives in the Control group, which is coloured orange. It looks like a small bracket that wraps around other blocks, with a number you can change.
A simple example: have your child set up "repeat 4" and place a "move 50 steps" block and a "turn 90 degrees" block inside it. When they click the green flag, the cat moves and turns four times and ends up drawing a square shape with its path. Children love seeing a perfect square appear from just two blocks inside a loop.
To use it:
- Drag the repeat block from Control into the code area.
- Type a number into it, such as 10.
- Drop the block you want repeated inside the bracket so it is hugged by the loop.
- Click the green flag and watch it run that many times.
The Forever Block
Sometimes you want something to keep happening with no end, like a fish swimming back and forth, or a star twinkling. For that, Scratch has the forever block, also in the orange Control group.
The forever block wraps around its blocks just like repeat, but it has no number, because it never stops on its own. It keeps looping until your child clicks the red stop button or until the project ends.
A favourite example: put "next costume," "move 10 steps," and a short "wait" block inside a forever loop. The sprite now walks endlessly across the stage, turning at the edges if you add a "if on edge, bounce" block. It feels alive, and it took only a handful of blocks.
Want to learn this properly?
Join the waitlist for our courses — beginner-friendly, project-first classes in Jalgaon.
Browse coursesLoops Inside Loops
Once children are comfortable, they often discover they can put a loop inside another loop. For example, a repeat block that draws one petal, placed inside another repeat block that turns a little each time, can draw a whole flower. There is no need to rush to this, but it is a wonderful moment when a child realises how much they can create with so little.
Tips for Parents
- Start with a small number. A "repeat 3" is easier to watch and understand than a "repeat 100."
- Compare the long way and the loop way. Let your child first stack a few repeated blocks, then replace them with one loop. Seeing the shortcut makes the lesson stick.
- Use real-life examples. "Brushing your teeth, you scrub the same way many times. That's a loop!" Everyday comparisons help the idea land.
Common Mistakes
- Blocks placed beside the loop, not inside it. If the action only happens once, check that the block is truly inside the loop's bracket, not stuck below it.
- Forever loop with nothing to slow it down. A forever loop with only a "move" block can shoot the sprite off the edge instantly. Add a short "wait" or a "bounce" block to keep it visible.
- Forgetting the stop button exists. If a forever loop seems "stuck," that is normal. The red button beside the green flag stops everything.
Frequently Asked Questions
What is the difference between repeat and forever? Repeat runs a set number of times and then stops. Forever runs until the project is stopped. Use repeat when you know how many times; use forever for ongoing action.
Can a loop be too fast to see? Yes. Computers are very quick. Adding a small "wait" block inside the loop slows it down so your child can enjoy watching it.
What's Next?
Loops are even more fun when combined with reactions. Read Events in Scratch to make loops start on a key press, and Conditionals (If-Then) in Scratch to make loops behave differently in different situations. Find all the guides on the kids' Scratch hub.
For friendly, paced lessons that build these ideas one happy step at a time, see our Scratch & Coding for Kids program in Jalgaon. Join the waitlist for the next batch.
Want to learn this properly?
Join the waitlist for our courses — beginner-friendly, project-first classes in Jalgaon.
Browse coursesFounder, Infoplanet
Atul Kabra founded Infoplanet in 2001 and has spent over two decades teaching programming — C, C++, Java, databases and more — to students across Maharashtra.
Related guides
कोडिंग सुरू करायचे सर्वोत्तम वय कोणते?
मुलांनी कोडिंग सुरू करायच्या सर्वोत्तम वयाबद्दल पालकांसाठी दिलासा देणारे मार्गदर्शक — वयानुसार प्रामाणिक तयारीची लक्षणे आणि एकच योग्य वेळ नसते व घाईची मुळीच गरज नाही हा स्पष्ट संदेश.
What's the Best Age to Start Coding?
A reassuring parent's guide to the best age for kids to start coding, with honest readiness signs by age and a clear message that there is no single right time and no rush.
Scratch मध्ये Animation बनवा
Scratch मध्ये animated गोष्ट बनवण्यासाठी पालकांसाठी मायेचे मार्गदर्शक: हालचालीसाठी costumes बदलणे, sprites सहजतेने सरकवणे, संवाद जोडणे आणि backdrops ने दृश्ये बदलणे.
