Lesson 10: Loops in Collector
Overview
Building on the concept of repeating instructions from "My Loopy Robotic Friends," this stage will have students using loops to collect treasure more efficiently on Code.org.
Purpose
In this lesson, students will be learning more about loops and how to implement them in Blockly code. Using loops is an important skill in programming because manually repeating commands is tedious and inefficient. With the Code.org puzzles, students will learn to add instructions to existing loops, gather repeated code into loops, and recognize patterns that need to be looped.
Agenda
Warm Up (10 min)
Bridging Activity - Loops (10 min)
Main Activity (30 min)
Wrap Up (5 - 10 min)
Extended Learning
View on Code Studio
Objectives
Students will be able to:
- Identify the benefits of using a loop structure instead of manual repetition.
- Breakdown a long sequence of instructions into the largest repeatable sequence possible.
- Create a program for a given task which loops a sequence of commands.
- Employ a combination of sequential and looped commands to reach the end of a maze.
Preparation
- Review the previous unplugged lesson and develop questions to remind students why loops are used.
- (Optional) Pick a couple of puzzles to do as a group with your class.
- Review CS Fundamentals Main Activity Tips - Lesson Recommendations.
- Make sure each student has a Think Spot Journal - Reflection Journal.
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the Teachers
- CSF Pre-Express Course
- CS Fundamentals Main Activity Tips - Lesson Recommendations
For the Students
- Unplugged Blockly Blocks (Grades K-1) - Manipulatives
- Think Spot Journal - Reflection Journal
Vocabulary
- Loop - The action of doing something over and over again.
- Repeat - To do something again.
Support
Report a Bug
Teaching Guide
Warm Up (10 min)
Introduction
Review with students the My Loopy Robotic Friends activity:
- What are loops?
- Why do we use them?
Bridging Activity - Loops (10 min)
This activity will help bring the unplugged concepts from "My Loopy Robotic Friends" into the online world that the students are moving into. Choose one of the following to do with your class:
Unplugged Activity Using Paper Blocks
Select a pattern from Stacking Cup Ideas - Manipulatives from the My Robotic Friends unplugged activity and give students Unplugged Blockly Blocks (Grades K-1) - Manipulatives prefilled with the collect
command, a repeat
loop, and the cardinal commands like E →
(East) and W ←
(West). Remember to choose a cup pattern that doesn't use any upside down cups, because there is no turn
command online for K-1 students. Next, have the students program a "robot" (a partner or the teacher) from their desks to get the correct stacking of the cups. Make sure that they understand that the blocks need to go from top to bottom and they all need to touch! Have the students pair share to check answers and resolve any questions or bugs that may come up.
Previewing Online Puzzles as a Class
Pull a puzzle from the corresponding online puzzles. We recommend puzzle 8. Using the My Robotic Friends - Symbol Key from the My Loopy Robotic Friends Unplugged Activity, have students draw out a pattern that they think will get Laurel the Adventurer to collect all the treasure. Ask the students to share. See how many other students had the same answer!
Main Activity (30 min)
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.
Prediction Levels:
CSF Pre-Express Course
As students work through the puzzles, see if they can figure out how many fewer blocks they use with a loop vs. not using a loop.
Wrap Up (5 - 10 min)
Journaling
Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.
Journal Prompts:
- What was today’s lesson about?
- How did you feel during today’s lesson?
- Draw a maze that you can solve using loops.
- Draw yourself using a loop to do an everyday activity, like brushing your teeth.
Extended Learning
So Moving
- Give the students pictures of actions or dance moves that they can do.
- Have students arrange moves and add loops to choreograph their own dance.
- Share the dances with the rest of the class.
Connect It Back
- Find some YouTube videos of popular dances that repeat themselves.
- Can your class find the loops?
- Try the same thing with songs!
Standards Alignment
View full course alignment
CSTA K-12 Computer Science Standards (2017)
AP - Algorithms & Programming
- 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.