← Back to Library
Lesson PlanFreeEN

E1: Loops - Repeat Until Loops

Students will learn how and why to use Repeat Until blocks. They will use Blockly preset programs and Challenge Cards to practice their new skills.

Gr. 4–4
E1: Loops - Repeat Until Loops

Lesson

Overview

Description

Students will learn how and why to use Repeat Until blocks. They will use Blockly preset programs and Challenge Cards to practice their new skills.

Objectives

  • identify the differences between Repeat, Repeat Forever, and Repeat Until blocks

  • differentiate between situations in which a Repeat, Repeat Forever, or Repeat Until block should be used

  • use Repeat Until blocks to revise code and complete coding challenges in an iterative process

  • construct an original program using a Repeat Until block

Before the Lesson

Prior Experience

It is recommended that students complete:

  • Level A-D Lessons: All

  • [Optional] Level A-D Challenge Cards: All

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

  1. Briefly review with students the definition of and uses for loops by asking:

    • What are loops? (Sample response: "The action of doing something over and over again.")

    • Why do we use loops in coding? (Sample response: "We use loops to make our codes more efficient and easier to write.")

  2. Say, "You have learned about different types of loops: Repeat Forever and Repeat loops. Compare and contrast the two different types of loops."

    • Sample response: "Repeat loops repeat a specific number of times, while Repeat Forever loops repeat until the user tells them to stop."

  3. Give an example of when each type of loop is used in real life, such as:

    • A Repeat loop: You put on one sock and repeat this action a second time.

    • A Repeat Forever loop: You breathe in and out. You repeat this action over and over again unless someone tells you to hold your breath.

Blockly In-App Puzzle (Optional)

  1. Have students complete the Dance Contest puzzle. You can find walkthroughs, solutions, and extensions for the puzzle.

  2. Have students update their Blockly Puzzle Checklists

  3. 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)

  1. Review Code.org's Course D, Lesson 8: https://curriculum.code.org/csf/coursed/8/

  2. Say, "In this activity, you were able to help the farmer plant using Repeat blocks."

    • Then ask, "How would your code have looked different if you had not been able to use Repeat blocks?" (Sample response: "The code would have been much longer.")

Quick Check

  • What are the advantages of using loops in code?

    • Sample response: "Using loops makes our code faster and more efficient to write."

  • In what situation would you want to use a Repeat loop as opposed to a Repeat Forever loop?

    • Sample response: "When writing your code, you use a Repeat loop when you want something to repeat a set number of times. You use a Repeat Forever loop when you want something to repeat until the program stops."

Direct Instruction

Introduction: Hide and Seek

  1. Project your tablet screen, open the Blockly app, and go to the menu at the top left of the screen.

  2. Go to the Create New Project menu and select the Hide and Seek preset program. Then tap "create."

    Hide and Seek
  3. Ask the students to look at the program and predict what they think will happen when it is run.

    • Run the program to see if the students' predictions were correct.

  4. Point to the Repeat Until block in the program and say, "This is a new kind of repeat block. With this block, Dash or Dot will repeat what's inside the loop until a specific event happens."

    • Ask the class, "What action will Dash repeat until there is an Obstacle in Front?" (Sample response: “Dash will look for Dot. Then Dash will move forward.”)

    • Ask the class, “What will happen when Dash sees an Obstacle in Front?"(Sample response: “Dash will look left.”)

Quick Check

  • What events are used for the Repeat Until blocks in this program? Why do you think the programmers chose those events?

  • Could you have used a Repeat Forever block to play the hide and seek program? Why or why not?

Guided Practice

Hide and Seek Exploration

  1. Ask the class, "How can we change the code so that Dash looks for Dot until we press the Top Button?"

    • Select a student volunteer to change the code by tapping on the Repeat Until block and selecting the Top Button icon.

    • Then run the program so the class can see how the program has changed.

  2. Continue selecting student volunteers to change the Repeat Until block in a similar manner. Encourage students to:

    • Change the Repeat Until event to Hear Clap or Object Behind.

    • Change the blocks inside the Repeat Until block.

Quick Check

  • What are the different kinds of events you could use for the Repeat Until block?

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!

Hide and Seek - Extension

  1. Have students use the Wonder Journal: Dash Planning, Dot Planning, and/or General Planning worksheets to design ways to add to or alter the Hide and Seek preset program. They can:

    • Change the cues for Dash.

    • Change and/or add more lights, looks, or sounds.

    • Add more drive blocks.

    • Change the event handler.

  2. 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 Dash and Dot while the code is running.

Challenge Cards (Optional)

  1. You can purchase our Learn to Code Challenge Card sets and Curriculum Guide here: https://logicsacademy.com/store/

  2. Have students complete the following Challenge Cards:

    • E1.1: Rootin' Tootin' Line Dance

    • E1.2: Dance Along with Dot

    • E1.3: Dance Machine Dash

  3. For each challenge, encourage students to:

    • Use the Wonder Journal: Dash Planning, Dot Planning, and/or General Planning worksheets 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.

  4. 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 and/or Dot while the code is running.

    • Update their Challenge Card Checklists.

Wrap Up

Student Presentations

  1. Have student groups take turns sharing one of their programs with the class. Encourage them to:

    • Explain their design thinking. (E.g., “We wanted to add animations to our program because we wanted to make Dash dance,” or “We used the Repeat Until block/s to control how Dash repeats each dance move.”)

    • Share any obstacles and difficulties they overcame during the activity. (E.g., “At first, we weren’t sure why we should use a Repeat Until block, but then we realized it gave us more control over our program. ”)

  2. 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 (use cues in your program)?"

    • "I like how you (changed the lights and sounds in your program)."

    • "What if you (added another event handler for Dot)?"

Follow-Up Questions/Discussion

  • How were the Repeat Until blocks used in this program?

    • Sample response: "The Repeat Until blocks allowed Dash to repeat a series of behaviors placed inside the Repeat Until block. The behaviors continued until an assigned behavior told Dash to stop or do something different."

  • What would life be like if you only used Repeat X Times or Repeat Forever loops?

    • Sample response: “When you are hungry, you put food in your mouth and Repeat Until you are full. If you used a Repeat Forever block you would never stop eating. If you used a Repeat block you might not get enough to eat or eat too much.”

  • If you lived in a world where your entire life needed programming, in what situations would you need to use a Repeat Until block?

    • Sample response: "I would use a Repeat Until block for my homework. I would repeat the work until it was complete."

Assessment

  • Use our Evaluation Rubric to review students' work and presentations.

  • [Optional] Share your students' work with the world using @logicsacademy and #dashanddot!

Educational Standards

CSTA

CSTA

  • 1B-AP-08: Compare and refine multiple algorithms for the same task and determine which is the most appropriate.

  • 1B-AP-10: Create programs that include sequences, events, loops, and conditionals.

  • 1B-AP-12: Modify, mix, and incorporate portions of an existing program into one's own work to develop something new or add more advanced features.

  • 1B-AP-16: Take on varying roles with teacher guidance, when collaborating with peers during the design, implementation, and review of program development.

ISTE

ISTE

  • 4d: Exhibit a tolerance for ambiguity, perseverance and the capacity to work with open-ended problems.

  • 5a: Formulate problem definitions suited for technology-assisted methods such as data analysis, abstract models and algorithmic thinking in exploring and finding solutions.

  • 6b: Create original works or responsibly repurpose or remix digital resources into new creations.

  • 7c: Contribute constructively to project teams, assuming various roles and responsibilities to work effectively toward a common goal.

NGSS

NGSS

  • 3-5-ETS1-2: Generate and compare multiple solutions to a problem based on how well they meet the criteria and constraints of the design problem.

  • 3-5-ETS1-3: Different solutions need to be tested in order to determine which of them best solves the problem, given the criteria and the constraints.

Common Core

Common Core

  • CCSS.ELA-LITERACY.W.2.6: With guidance and support from adults, use a variety of digital tools to produce and publish writing, including in collaboration with peers.

  • CCSS.ELA-LITERACY.W.2.8: Recall information from experiences or gather information from provided sources to answer a question.

  • CCSS.ELA-LITERACY.SL.3.1: Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 3 topics and texts, building on others' ideas and expressing their own clearly.

  • CCSS.ELA-LITERACY.SL.3.3: Ask and answer questions about information from a speaker, offering appropriate elaboration and detail.

  • CCSS.ELA-LITERACY.SL.3.4: Report on a topic or text, tell a story, or recount an experience with appropriate facts and relevant, descriptive details, speaking clearly at an understandable pace.

Alberta - Grade 4 - ICT

Grade 4

ICT

C5: Students will use technology to aid collaboration during inquiry.

C6: Students will use technology to investigate and/or solve problems.

F6: Students will demonstrate a basic understanding of the operating skills required in a variety of technologies.

Ontario - Grade 4 - Mathematics

Grade 4

Mathematics: Algebra (Coding)

C3.1 solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves sequential, concurrent, repeating, and nested events

Nova Scotia - Grade 4 - ICT

Grade 4

ICT

P2: Students will be expected to use digital tools to develop ideas and original works in innovative ways.

TOC1: Students will be expected to 

  • safely use many forms of current technology for learning with growing competence 

  • demonstrate conceptual understanding of how information and communication technology, digital tools, and authorized networks support their learning 

  • use terminology related to information and communication technology

British Columbia - Grade 4 - ADST

Grade 4

ADST

• Make changes and test again, repeating until satisfied with the product 

• Use materials, tools, and technologies in a safe manner, and with an awareness of the safety of others, in both physical and digital environments 

• Identify the skills required for a task and develop those skills as needed 

• Use familiar tools and technologies to extend their capabilities when completing a task 

• Demonstrate a willingness to learn new technologies as needed