🔄

Loop

(Loo-p)

What is it? 🤔

A loop is when you do the same thing Over and Over again.

Instead of telling a robot "Jump, Jump, Jump, Jump, Jump", you can just say: "Jump 5 times!" It saves a lot of breath! 😮‍💨

Example: The Cereal Loop 🥣

🥄 Scoop
😋 Eat
👀 Check Bowl

Keep doing this UNTIL the bowl is empty!

💡 Fun Fact

If you forget to tell the computer when to stop, it will keep going FOREVER! That's called an Infinite Loop. ♾️

🎮 Try It Yourself!

Tell the robot how many times to jump.

Jump times!
🤖
0

for (i = 1; i <= 3; i++) {
  robot.jump();
}

🕵️ Secret Mission 🕵️

PASSPORT CODE: REPEAT