< Course A (2024)

Lesson 9: Loops with Laurel

45 minutes

Overview

In this skill-building lesson, students continue learning the concept of loops. Here, students use loops to collect treasure in open cave spaces.

Purpose

This lesson gives students more practice with loops and introduces a new block, get treasure. The block works just like pick corn did in Harvester. These puzzles are more open, giving students more flexibility for their final solutions.

CSTA K-12 Computer Science Standards (2017)
    • 1A-AP-09 - Model the way programs store and manipulate data by using numbers or other symbols to represent information.
    • 1A-AP-10 - Develop programs with sequences and simple loops, to express ideas or address a problem.
    • 1A-AP-11 - Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions.
    • 1A-AP-14 - Debug (identify and fix) errors in an algorithm or program that includes sequences and simple loops.

Agenda

Objectives

Students will be able to:
  • Break down a long sequence of instructions into the smallest repeatable sequence possible.
  • Examine a program with loops and debug to solve the puzzle.
  • Identify the benefits of using a loop structure instead of manual repetition.

Preparation

  • Play through the puzzles to find any potential problem areas for your class.
  • (Optional) Pick a couple of puzzles to do as a group with your class.
  • Review *CSF Lesson Recommendations
  • Make sure each student has a reflection journal

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the teachers
For the students

Vocabulary

  • Algorithm - A list of steps to finish a task.
  • Debugging - Finding and fixing problems in an algorithm or program.
  • Loop - The action of doing something over and over again.
  • Repeat - To do something again.

Teaching Guide

Warm Up (10 minutes)

Introduction

Display: Show "Review” slide

Quickly review the definition of a loop, the action of doing something over and over again.

  • What are loops?
  • Why do we use them?

Display: Show "Vocabulary" slide

Say:

  • Loop - The action of doing something over and over again.
  • Repeat - To do something again.

Main Activity (30 minutes)

Teacher Demonstration

We've included some multiple choice prediction levels that are difficult for non-readers. These levels are optional for you to review with your class to help prepare for the puzzles to come. Alternatively, these could be used after finishing the stage as a review for the class.

Teaching Tip

Some students may be curious about what happens when you add more blocks inside a repeat loop. Make sure to explain that the repeat loop goes through every block inside it once, then starts back over from the top and repeats that. It does not just repeat each block inside that many times and move to the next one.

Prediction Levels:

Display: Show “Decompose it!” slide

Remind students to break each puzzle down into smaller steps.

Display: Show “Video: The Collector” slide

Display: Show “Level 2-3: Skill Building” slide

Display: Show “Video: Using the Repeat Block” slide

Display: Show “Level 11: Challenge” slide

Display: Show “Level 12-14: Practice” slide

Display: Show “Lesson Extras” slide

As students work through the puzzles, see if they can figure out how many blocks they use with a loop vs. without a loop.

Wrap Up (5 minutes)

Reflection

Display: Show "Reflection” slide

Prompts:

  • What was today’s lesson about?
  • Draw a face that shows how you felt about today's lesson in the corner of your journal page.
  • How did loops make your program easier to write?
  • Draw something that uses loops.
Creative Commons License (CC BY-NC-SA 4.0).

This work is available under a Creative Commons License (CC BY-NC-SA 4.0).

If you are interested in licensing Code.org materials for commercial purposes contact us.