Lesson 6: Programming Unplugged: My Robotic Friends

Overview

Using a set of symbols in place of code, students will design algorithms to instruct a "robot" to stack cups in different patterns. Students will take turns participating as the robot, responding only to the algorithm defined by their peers. This segment teaches students the connection between symbols and actions, the difference between an algorithm and a program, and the valuable skill of debugging.

Purpose

This unplugged lesson brings the class together as a team with a simple task to complete: get a "robot" to stack cups in a specific design. Students will work to recognize real world actions as potential instructions in code. The designing of precise instructions will also be practiced, as students work to translate worded instructions into the symbols provided. If problems arise in the code, students should work together to recognize bugs and build solutions. This activity lays the groundwork for the programming that students will do throughout the course, as they learn the importance of defining a clearly communicated algorithm.

Agenda

Warm Up (5 min)

Main Activity (45 min)

Wrap Up (10 min)

View on Code Studio

Objectives

Students will be able to:

  • Attend to precision when creating instructions
  • Identify and address bugs or errors in sequenced instructions

Preparation

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.
  • Bug - Part of a program that does not work correctly.
  • Debugging - Finding and fixing problems in an algorithm or program.
  • Program - An algorithm that has been coded into something that can be run by a machine.

Support

Report a Bug

Teaching Guide

Warm Up (5 min)

Discussion Goal

The goal of this quick discussion is to call out that while robots may seem to behave like people, they're actually responding only to their programming. Students will likely refer to robots from movies and TV that behave more like humans. Push them to consider robots that they've seen or heard of in real life, like Roombas, or even digital assistants like Amazon Alexa.

Talking to Robots

Display: Watch one of the videos below to give students context for the types of things that robots can do:

Discuss: Refer to the video that you chose and ask students how they think that the robot knew what to do. Does a robot really “understand” what you say? Is it worried about getting in trouble if it doesn't do what it's told?

Say: Robots can only do what they've been told to do, but we don't just tell them using words. In order to do something, a robot needs to have a list of steps that it can read. Today, we are going to learn what it takes to make that happen.

Main Activity (45 min)

Introduction and Modeling

Robot Symbols

Set Up: Have stacks of cups or cut paper trapezoids available for groups.

Display: Display the My Robotic Friends - Symbol Key or write the allowed actions on the board - make sure these are in a place where they can be seen for the whole activity. Explain to the class that these will be the only six actions that they can use for this exercise. For this task, they will instruct their “robot” friend to build a specific cup stack using only the commands listed on the key.

Model: In order to explain how the instructions are intended to work, model for the class how to create and follow an algorithm for replicating a simple pattern. Place a single stack of cups in front of you to start.

Display: Hold up the pattern you plan to model. A simple three cup pattern is a great place to start.

Prompt: Ask the class what the first instruction should be, using only the six instructions allowed. The first move should be to "pick up cup." If students suggest something else from the list, perform that action and allow them to see their error. If they suggest something not from the list, make a clear malfunction reaction and let them know that the command is not understood.

With cup in hand, ask the class to continue giving you instructions until the first cup is placed. This is a great place to clarify that a "step forward" and "step backward" each imply moving half a cup width. See the image below for reference.

3 cup pattern

Continue asking for instructions from the classroom until you have completed the entire design.

Once your stack is complete, point out that they just gave you a list of steps for completing a task. That's an algorithm. Algorithms are great for sharing ideas, but spelling them out word by word can take a long time. That's what the symbols are for! When you change an algorithm into symbols that a robot (or computer) understands, that's called programming.

Ask the class to help you write the "program" for that first move, and then the rest of the moves necessary to complete the pattern. Depending on the confidence of your students, you might switch back and forth frequently between acting as the "robot" and writing down the code, or you might push them to write the whole program before you will implement it. One possible solution looks like this:

3 cup solution

Volunteer: Once the class has completed the model program, ask one of the students to come up and act as the "robot" to ensure that the program really works. Encourage them to say the instructions out loud as they "run" the code.

Programming Your Robots

Group: Place students into groups of 4. Each group should then further break down into two pairs - each pair will develop their own program to be "run" by the other pair.

Distribute: Give each group one stack of cups or paper cutouts.

Display: Show Stacking Cup Ideas - Manipulatives to the class or hand out individual copies for groups to use. Have each pair (not group) choose which idea they would like their robots to do. Try to push for an easier idea for the first time, then have them choose a more complex design later on. Encourage pairs to keep their choice secret from the other half of their group.

Discuss: Give each pair time to discuss how the stack should be built, using only the provided symbols. Make sure each group writes down the "program" somewhere for the "robot" to read later.

Teaching Tip

Enforcing the rules: While the robot is working on the stack make sure that the class knows:

  • Programmers are not allowed to talk when the robot is working. This includes blurting out answers or pointing out when the robot has done something wrong.
  • Programmers should raise their hand if they see a bug.

Do: Once both of the group's pairs have decided on their algorithms, they can take turns being "robots" for each other by following the instructions each pair wrote. Encourage students to watch their "robot" closely to ensure that they are following instructions. If a student sees a bug and raises their hand, have the robot finish the instructions to the best of their ability. Afterward, have the students discuss the potential bug and come up with a solution. Continue repeating until the stack is built properly.

Circulate: Look for groups who are trying to take shortcuts by adding things (like numbers) to their code. Praise them for their ingenuity, but remind them that for this exercise, the robots do not understand anything but the provided symbols. If you like, you can hint that they should save their brilliant solution for the next time they play this game, since they might get the chance to use it soon!

Iterate: Depending on your time available, mix up the pairs and give them a chance to do a different pattern. Each time groups repeat the process, encourage them to choose a more challenging pattern.

Discussion Goal

Sense making: The goal of this discussion is to give students space to make sense of their experience both as robot and programmer. The questions are intentionally broad, but designed to get students thinking about the challenges of writing a clear program and the constraints of a robot or computer in interpreting your instructions.

Discuss: After everyone has had a chance to be the robot, bring the class back together to discuss their experience. In particular, discuss as a class:

  • What was the most difficult part of coming up with the instructions?
  • Did anyone find a bug in your instructions once your robot was following them?
    • What was the bug?
    • Why do you think you didn't notice it when writing the program?
  • When you were the robot, what was the hardest part of following the instructions you were given?

Wrap Up (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 stack of cups that the robot made today.
  • Draw a stack of cups that you would like a robot to make someday!

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.