Hero background

Algorithmic Looping Mastery

STEM • 65 • 25 students • Created with AI following Aligned with Common Core State Standards

Download now

Free PDF · we'll email you a copy

STEM
65
25 students
23 February 2026

Teaching Instructions

lesson plan

Overview

This 65-minute engaging STEM session introduces 7th graders to programming loops through robotics and coding activities aligned to Common Core State Standards, focusing on algorithmic thinking, computational fluency, and problem-solving. Students will design, code, debug, and optimize repeatable robot actions using VEXcode VR and VEX Robotics, applying loops to extend program functionality efficiently.


Learning Objectives

By the end of the lesson, students will be able to:

  • CCSS.Math.Content.7.EE.B.4: Use variables to represent quantities and write, interpret, and analyze expressions involving whole number exponents and repeated operations.
  • CCSS.ELA-Literacy.RST.6-8.3: Follow precisely a multistep procedure when carrying out experiments or designing solutions.
  • ISTE Standard 4: Innovative Designer: Use a variety of technologies within a design process to identify and solve problems by creating new, useful or imaginative solutions.
  • Design and implement algorithms using loops for repetitive robot movements.
  • Debug and optimize loop-based code to meet specific task requirements.
  • Collaborate effectively in pairs to develop and refine algorithmic thinking.

Materials Needed

  • Classroom computers with internet access and VEXcode VR installed or available online
  • VEX Robotics kits (if physical robots are accessible)
  • Whiteboards or paper for flowchart design
  • Projector to display coding environment visuals
  • Student notebooks
  • Timer or stopwatch

Lesson Outline

1. Introduction & Engagement (10 minutes)

  • Hook: Present a short video or live demonstration of a robot performing a "Thank-You Robot Shuffle" routine. Explain how it moves forward, backward, pauses, and repeats motions.
  • Ask: How do you think the robot remembers and repeats its routine? What if the routine needed to happen 10 or 20 times? Discuss challenges with copying repetitive commands and introduce the concept of loops as an efficient solution.
  • Connect to the real-world importance of loops in programming automation and robotics.

2. Exploration: Understanding Loops (15 minutes)

  • Using projector, review key vocabulary: loop, repeat loop, forever loop, algorithm, debugging.
  • Introduce the client’s updated design requirement: robot shuffle lasts 50–70 seconds, includes forward/backward movement, and at least one pause.
  • Show example code snippets using VEXcode blocks illustrating:
    • A simple repeat loop (e.g., repeat 5 times)
    • A forever loop
  • Teacher-guided activity: Analyze pre-built code samples projected on screen; students decide which loop type fits the client’s needs and justify answers through small-group discussion.
  • Verify understanding by listing correct loop logic statements (interactive quiz or whiteboard responses).

3. Guided Practice: Program a Looping Shuffle (20 minutes)

  • Students pair up to review their prior flowchart from previous activities (Activity 1.4 Robot Shuffle). Each pair identifies repetitive sections of the shuffle program suitable to encapsulate in a loop.
  • Open VEXcode and:
    • Save existing shuffle program as LoopingShuffle
    • Edit code to include a repeat loop for extending routine length to client specifications
    • Add at least one wait/pause block inside the loop to mimic a realistic shuffle step
    • Include comments explaining loop sections to scaffold computational thinking
  • Circulate to provide hands-on support, prompt debugging strategies, and encourage test runs.
  • Encourage pairs to peek at the stop project block and explore how to stop loops efficiently.

4. Extension Challenge: Limit Switch Stop (10 minutes)

  • Introduce limit switch as an input control to immediately stop the shuffle routine.
  • Discuss scenarios: Not all viewers want a long shuffle; pressing a limit switch should halt the program gracefully.
  • Demonstrate how to program a limit switch sensor in VEXcode to break a loop using stop project block.
  • If time permits, students add a limit switch condition to their flowcharts or pseudocode.

5. Innovation Task: Cleanup Algorithm (8 minutes)

  • Introduce VEXcode VR’s Coral Reef Cleanup playground. Students brainstorm in small groups an algorithm that:
    • Uses loops to repeat trash cleanup tasks
    • Utilizes sensing blocks to detect and pick up trash efficiently
  • Students sketch a quick flowchart illustrating their cleanup algorithm with loops and sensing blocks.

6. Wrap-Up & Assessment (2 minutes)

  • Quick 3-question exit ticket:
    1. Why are loops useful in programming repetitive robot actions?
    2. What is the difference between a repeat loop and a forever loop?
    3. How does adding a limit switch improve your robot’s program?
  • Collect answers for formative assessment and to guide next lessons.

Assessment

  • Formative: Observation during pair programming and debugging; group discussions; exit ticket responses.
  • Performance: Successful creation and testing of a looped shuffle program meeting 50–70 second duration.
  • Reflection: Students add comments to their code explaining loop functionality, demonstrating conceptual understanding.

Differentiation

  • For Struggling Learners: Provide sentence starters for flowchart explanations, scaffold example codes, and allow use of physical blocks before coding on computers.
  • For Advanced Learners: Challenge to combine nested loops, add multiple sensor inputs, or optimize code for minimal lines while meeting the client criteria.

Teacher Notes

  • Reinforce computational thinking by emphasizing pattern recognition in repetitive actions.
  • Encourage precise use of vocabulary: algorithm, loop, repeat, sensor, condition, debugging.
  • Foster collaboration and peer feedback in pair programming.
  • Remind students to save regularly and comment their code for clarity.

This hands-on, conceptually rich lesson empowers students to grasp core programming concepts aligned to CCSS and ISTE standards, while fostering creativity and critical problem-solving through robotics and coding with immediate real-world connections.

Create Your Own AI Lesson Plan

Join thousands of teachers using Kuraplan AI to create personalized lesson plans that align with Aligned with Common Core State Standards in minutes, not hours.

AI-powered lesson creation
Curriculum-aligned content
Ready in minutes

Created with Kuraplan AI

Generated using gpt-4.1-mini-2025-04-14

🌟 Trusted by 1000+ Schools

Join educators across United States