< Course E (2021)

Lesson 1: Follow the Algorithm

45 minutes

Overview

In this context-setting lesson, students will play a game intended to get them thinking about sequential instructions.

Purpose

This lesson is designed to prepare students to think about one of the core programming concepts in Sprite Lab, behaviors.

CSTA K-12 Computer Science Standards (2017)
    • 1B-AP-12 - Modify, remix or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.

Agenda

Objectives

Students will be able to:
  • begin to make connections about a new way to write programs

Preparation

  • Play through the puzzles to find any potential problem areas for your class.
  • Make sure every student has a reflection journal.

Links

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

For the teachers

Vocabulary

  • Behavior - An action that a sprite performs continuously until it’s told to stop.
  • algorithm - A list of steps to finish a task

Teaching Guide

Warm Up (10 minutes)

Introduction

Think-Pair-Share: Think of hobby, sport, or activity that you know how to do well. What does it take to do it well? Are there times when you need think about multiple things or perform different actions at the same time?

  • What parts of your body are you using? Does this change at different points?
  • Are there times when you need to stop one action before you can begin another? (For example, you must stop dribbling the basketball before you can shoot.)

Goal: Help students think about times when they must keep track of multiple tasks or instructions simultaneously. The main activity will get students performing silly actions, either in sequence or simultaneously. This will eventually lead to connections about a new way to write programs, but you don't need to get the discussion there yet.

Main Activity (20 minutes)

Follow the Algorithm

Remarks

Today we’re going to start with a quick game. In this game, I will be giving you all commands to follow and your job is to follow my instructions. The commands will always start with “begin” or “stop”. If I tell you to begin doing something, you need to start that behavior and keep it going until I tell you to stop. I might also tell you to “stop everything” which means you can end all of the behaviors I’ve given you so far. We’ll play 3 rounds and after each round I’ll ask you all a couple questions.

Rules

All commands should be prefaced with either “begin” or “stop”.

When players are told to “begin” a behavior, they should continue it until told to “stop”. For example, players should not told be told to clap once, but might be told to “begin clapping”. Their clapping should continue until they are told to “stop clapping” even if they are given other new behaviors in between.

The leader can also call for the players to “stop everything”.

This should result in everyone just standing at rest regardless of all previous commands.

You as the teacher should take on the role of the leader. You can try make up your own sequences, but here are some you can try. Be sure to give a little space between commands. For each of these sections, consider running through the entire sequence without any discussion and later repeating it again after everyone has had a chance to debrief and process any confusion.

Round 1 (Basic):

  • Begin marching in place.
  • Stop marching in place.
  • Begin clapping.
  • Stop clapping.
  • Begin marching in place.
  • Begin clapping.
  • Stop everything.

Debrief: What happened when you were told to clap but you were already marching in place? What happens if you are told to begin two different behaviors at once?

Round 2 (Intermediate):

  • Begin waving your arms in the air.
  • Begin bobbing your head.
  • Stop waving your arms in the air.
  • Stop bobbing your head.
  • Begin shaking your knees.
  • Begin flapping your arms like a bird.
  • Stop shaking your knees.
  • Begin bobbing your head.
  • Begin marching in place.
  • Stop flapping your arms like a bird.
  • Stop everything.

Debrief:

What kinds of instructions caused people to make mistakes? What strategies do you think are helpful for making sure you follow instructions correctly? Why is it important to keep track of each behavior separately?

Round 3 (Challenging)

  • Begin crouching.
  • Begin tapping your head.
  • Stop crouching.
  • Stop tapping your head.
  • Begin jumping up and down.
  • Begin tapping your head.
  • Stop everything.
  • Begin clapping.
  • Begin flapping your arms like a bird.
  • Stop everything.
  • Begin crouching.
  • Begin jumping up and down.
  • Stop everything.
  • Begin tapping your knees.
  • Begin tapping your head.
  • Stop everything.
  • Begin spinning to the left.
  • Begin spinning to the right.
  • Stop spinning to the left.
  • Stop spinning to the right.

Discussion: What happens if two behaviors seem to conflict with each other?

What should you do when told to clap your hands and flap your arms at the same time?

How can you jump up and down while crouching?

What happens if you need to tap your knees and your head at the same time?

When you were told to spin in two opposite directions what did you see people do?

What would happen if you were told to spin left and right at the exact same time?

Students should understand that some behaviors conflict with each other which can result in unexpected outcomes. It’s possible for two opposite behaviors to effectively cancel each other out.

Extension

If you want to make things even more complicated, you can consider changing the rules so that only some players follow some commands. For example, you could try commands like “All girls begin spinning to the left”, “All boys begin clapping your hands”, or “Everyone stop everything.”

Wrap Up (15 minutes)

What did we learn?

Say: In this activity, you followed the step-by-step instructions that I gave you. We call this an algorithm.

Invite students to think about other times in their lives when they use or follow algorithms. Examples include following a schedule or a daily routine. Let students know that in the next lesson, they will be able to give an algorithm for their computers to follow.

Reflection

Prompt:

Think back to the activity or hobby you discussed at the beginning of class. Using "begin" and "stop" commands write down the instructions you could give someone if you wanted them to act like they were they were doing it. Be sure to remember when they might need to stop something before beginning something new.

Teaching Tip

Reflection prompts like these can be completed in a variety of styles. Journaling or discussion (with groups or partners) are great options!

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.