# Lesson 5: Programming Unplugged: Happy Maps

## Overview

The bridge from algorithms to programming can be a short one if students understand the difference between planning out a sequence and encoding that sequence into the appropriate language. This activity will help students gain experience reading and writing in shorthand code.

## Purpose

This unplugged lesson brings together teams with a simple task: get the "flurb" to the fruit. Students will practice writing precise instructions as they work to translate instructions into the symbols provided. If problems arise in the code, students should also work together to recognize bugs and build solutions.

## Objectives

### Students will be able to:

• Translate an algorithm into a program.
• Decode and run a program created by someone else.

## Preparation

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

## Vocabulary

• Program - An algorithm that has been coded into something that can be run by a machine.

# Teaching Guide

## Warm Up (15 - 20 min)

### Step-by-Step

Goal: This portion of the lesson will set the stage for making the connection between an algorithm and a program.

• Ask your students for directions to the chalkboard.
• If they start shouting simultaneously, explain that you can only hear one instruction at a time. Call on students individually if that helps.
• When you reach the board, ask for instructions to draw a smiley face.
• Again, request this one step at a time
• Explain that many tasks can be described using a specific list of instructions. That list is called an algorithm.

This is where we introduce the activity. In your Happy Map Cards, there are single and double step maps. Show the students that the point of these maps is to figure out how to get the Flurb to the fruit. Students should then use their words to solve these puzzles in small groups. Example algorithms include:

• Move the Flurb up
• Move the Flurb North, then West

### Discuss

Lesson Tip:

If you have time and motivation, get your students to bring their stuffies into school for this lesson and have them create programs to move stuffies from square to square, outlined in tape on the carpet.

• Ask if any students want to share their algorithm for one of the mazes.
• Can everyone see how the volunteer came up with that answer?
• Is there any debugging that needs to be done?
• Now, what if we tried to move our Flurb through a 10-step maze?
• Could we remember all of the steps?
• What if we had to write all of the steps down in words?
• How could we make this easier?

Show students how to represent the algorithms that they just created using arrows (either drawn, or cut from the Happy Maps Game Pieces). Have a short discussion about how quick and easy this “code” makes the process of getting the Flurb where it needs to be.

### Vocabulary

• Program (or Code): an algorithm that has been encoded into something that can be run by a machine.

## Main Activity (15 - 20 min)

### Happy Maps Programming

Goal: Happy Maps Programming will help students translate an algorithm into code.

Now that the students have had some practice encoding algorithms, have them work on some larger maps.

Encourage the students to follow these steps:

• Discuss an algorithm to get the Flurb to the fruit.
• Encode the algorithm into arrows to share with the class.
• Try their code to see if everything works as expected.
• Debug any issues and fix their code until it works correctly.

Make sure to bring the class back together at least a couple of times to allow students to share their code or the things that they have learned.

## Wrap Up (8 min)

### Flash Chat: What did we learn today?

When it’s time to wind down class, ask students if they can tell the difference between an algorithm and code.

Both are a list of steps, but code (a program) has been encoded in a way that can be run by a machine (or a kindergartener!)

Do you think that someone who spoke another language would be able to run your program? Why or why not?

### Journaling

#### Journal Prompts:

Students should be encouraged to capture their thoughts in their journal after each activity (with text or images.)

Choose a journal prompt that will help students remember the purpose of this exercise. These could include:

• In this game, we made programs for people to run. What else can read a program?
• How did you know if there was a bug in your program?

## Extension Activities

• Create a life-size grid on the rug with tape and have student bring stuffies to school. Now students can program friends to move their actual stuffies as directed in the programs.
• Have students create their own maps for other students to solve using programs.

## Standards Alignment

#### CSTA K-12 Computer Science Standards

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-11 - Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions.