(Francais) C5: Loops - Multiple Loops
Description Level C, Lesson 5: Students will use multiple loops in a program. They will use Blockly preset programs and Challenge Cards to practice their new skills. Objectives Understand how and when

Educational Standards
CSTA
ISTE
NGSS
Common Core
Build the Lesson
Prior Experience
It is recommended that students complete:
- Level A-B Lessons: All
- Level C: Lessons 1-4
- [Optional] Level A-B Challenge Cards: All
- [Optional] Level C Challenge Cards: C 1.1-2.6
You can purchase our Learn to Code Challenge Card sets and Curriculum Guide here: https://store.makewonder.com/#/education
Preparation
- Fully charge the tablets and robots.
- Install the Wonder Workshop Blockly app on each tablet.
Review
Loops Review
Briefly review how students used loops previously by asking:
- “How were loops used in the Square Dance program?” (Sample response: “Dash created a square dance by repeating drive and turn block moves four times.”)
- “What is the purpose of loops?” (Sample response: “Loops make our program easier and faster to write.”)
- “Why are loop blocks in the shape of a C?” (Sample response: “Loop blocks are shaped this way so that we can place the blocks we want repeated inside of them.)
Blockly In-App Puzzle [Optional]
- Have students complete the Dash Interrupting Robot puzzle. You can find walkthroughs, solutions, and extensions for the puzzle.
- Have students update their Blockly Puzzle Checklists.
- Note: If previous puzzles are locked, show students how to quickly unlock them using this strategy: https://help.makewonder.com/customer/en/portal/articles/2318965-how-can-i-reset-challenges-unlock-free-play-or-unlock-wonder-cloud-?b_id=14312
Code.Org Connections [Optional]
- Review Code.org’s lesson focusing on loops: https://curriculum.code.org/csf/courseb/9/.
- After completing the lesson, ask:
- “Is there a limit to the number of loops we can add to a program? How do you know?” (Sample response: “There is no limit to the number of loops you can add. In this program, we were able to use as many loops as we needed.”)
- “How would your program have looked if you had not used loops?” (Sample response: “The program would have been much longer if we didn’t use loops.”)
Instruction
Introduction
- Say, “Sometimes, you need more than one loop to solve a problem.”
- Review real-life examples of problems that would take multiple loops to solve. For example:
- When playing an instrument, sometimes you repeat different parts of the music at different times. You might repeat the music for each stanza 3 times and repeat the chorus 3 times. This would require 2 different loops.
- When playing basketball, you use a loop to dribble the ball more than once. Then you use a different loop to shoot the ball through the hoop more than once.
- Ask, “When would we want to use more than one loop when we program Dash or Dot?”
- Sample response: “We’d want more than one loop if we wanted Dash to repeat a light pattern and THEN repeat a different light pattern.”
Quick Check
- When do you need to use more than one loop in real life? (Sample response: “In music, you need to repeat different parts of the music at different times.”)
- How could we use more than one loop when programming Dash or Dot? (Sample response: “We could have Dot repeat some sounds and THEN repeat a light pattern.”
Guided Practice
Activity: Dot Light Moves
- Project your tablet screen, open the Blockly app, and go to the menu at the top left of the screen.
- Go to the Create New Project menu and select the Dot Light Moves preset program. Then tap “create.”

- Ask students to look at the program and predict what they think will happen when it is run.
- Run the program and see if the students’ predictions were correct.
- Say, “In this program, we are using two loops to repeat different patterns. What are the two patterns that we’re repeating?”
- Sample response: “We’re repeating a truck horn sound followed by red and yellow lights in one pattern and a dog sound followed by orange and green lights in the other pattern.”
- Ask, “What would happen if we changed the number specified on the Repeat block?” (Sample response: “The number of times the code inside the block was repeated would change according to the number specified on the Repeat block.”)
- Change the number on the Repeat block and have students observe and share what happens.
- Ask, “What would happen if we changed the first Repeat block to a Repeat Forever block?” (Sample response: “If we changed the first Repeat block to a Repeat Forever block, then the code inside that block would never stop repeating and we’d never get to the code inside the second Repeat block.”)
- Change the first Repeat block to a Repeat Forever block and run the program. Have students observe and share what happened.
- Ask, “How could we change the Eye Pattern?” (Sample response: “We could change the eye pattern by choosing the Eye Pattern block and tapping the eye lights we want to turn on or off.”)
Quick Check
- If you wanted to use more than one Repeat block in your code, should the first block be a Repeat block or a Repeat Forever block? Why?” (Sample response: “It should be a Repeat block. If it were a Repeat Forever block, I would never get to the second Repeat block since the Repeat Forever block would repeat until I told it to stop.”)
- How many Repeat blocks can you use in your code? (Sample response: “You can add as many Repeat blocks as you want.”)
Wrap Up
Student Presentations
- Have student groups take turns sharing one of their programs with the class. Encourage them to:
- Explain their design thinking (e.g., "We added another Repeat block to our program so that we could repeat a different pattern").
- Share any obstacles and difficulties they overcame during the activity (e.g., "We weren’t sure how to turn the eye lights on and off, but then we realized that we could turn them on or off by tapping on the shapes around the eye").
- Encourage students to ask each other how they accomplished different objectives and give each other feedback on their programs. Possible questions/feedback includes:
- “How did you (add an animation)?”
- “I like how you (added another Repeat block to the program.)”
Follow-Up Questions/Discussion
- What would our program look like if we added multiple loops under a When block? (Sample response: “Dot would only perform the loops when they were triggered by the event in the When block.”)
- How could Repeat blocks help Dot create 2 different light patterns? (Sample response: “When the light blocks were in the Repeat block, the lights would repeat over and over again to make a pattern. We could use 2 Repeatblocks to make 2 different light patterns.”)
Assessment
- Use our Evaluation Rubric to review students' work and presentations.
- [Optional] Share your students' work with the world using @logicsacademy and #dashanddot!
Independent Practice
Instructions
Have students work on the following activities in small groups (ideally 2-3 students per robot).
Encourage students to share tablet and robot time. Have them establish and rotate through roles such as:
- Lead Programmer: Holds the tablet and manipulates the code.
- Robot Wrangler: Retrieves and resets the robot after every program attempt.
- Documentarian: Records group results, thoughts, and progress. Illustrates group designs and ideas.
When students work together while coding, they're able to help each other identify mistakes and develop creative solutions!
Dot Light Moves Extension
- Have students use the Wonder Journal: Dot Planning and/or General Planning worksheet to design ways to add to or alter the Dot Light Moves preset program. They can:
- Change the eye pattern.
- Add/change the sounds.
- Change the light colors.
- Add animations.
- After they finish revising the program, have students:
- Complete a Wonder Journal: Reflection worksheet.
- Take a screenshot of their Blockly code.
- Take a video of Dot while the code is running.
Challenge Cards
- You can purchase our Learn to Code Challenge Card sets and Curriculum Guide here: https://logicsacademy.com/store/
- Have students complete the following Challenge Cards:
- C 3.1: Spaceship Spinout!
- C 3.2: Help, help, help!
- C 3.3: Robot Rescue!
- For each challenge, encourage students to:
- Use the Wonder Journal: Dash Planning and/or General Planning worksheet to discuss how they can complete the challenge.
- Review the Troubleshooting and Problem Solving & Debugging worksheet if they run into any problems with their code.
- After they finish each challenge, have students:
- Complete a Wonder Journal: Reflection worksheet.
- Take a screenshot of their Blockly code.
- Take a video of Dash while the code is running.
- Update their Challenge Card Checklists.
