Programming Each Other

Students learn about thought processes involved in converting problems into subproblems and logical steps. Teams investigate the characteristics and write examples of flawed instructions as well as effective programs, using technical terminology to explain their revisions.

An exciting and unique feature of this challenge is that it is “unplugged”, enabling students to identify, explain, and apply computational learning through hands-on activities.

What Is the Programming Each Other Challenge?


In this challenge, students learn about the thought processes involved in breaking down problems and converting them into logical steps. Throughout the challenge, students investigate real-world problems that can be broken down into smaller subproblems. They explore complex programming concepts as they try to systematize activities that they do on a daily basis.

An exciting and unique feature of this challenge is that it is “unplugged.” Many young people spend a large amount of time looking at screens (both in and out of school). The Programming Each Other Challenge allows students to explore the thought processes of programming while being active, whether they are working with their teams to learn a new card trick or learning new dance steps.

To start the challenge, students receive a letter from a fictional publisher requesting ideas for a book that will introduce young children to programming. The publisher asks students to write programs for accomplishing everyday tasks. In order to make the story more interesting and the learning goals more complex, students learn about the characteristics and write examples of flawed instructions as well as effective programs, using technical terminology to explain their revisions.

Throughout the unit, students explore some of the basic challenges inherent to programming. They discuss and practice increasingly complex tasks with each successive activity. Each new level of difficulty is designed to introduce specific programming concepts, including:

  • Loops (repetition of sections of code)
  • Conditional Statements (determination of which action is performed in a given scenario)
  • Variables (temporary place holder for data that may take on more than one meaning in a program)
  • Error handling (steps to take if a program encounters unexpected data)

Each lesson includes optional tech extensions, opportunities for students to apply their knowledge and present their findings in a collaborative environment. 

Watch Video

Lesson Plan Overview


Lesson 1: Introducing the Challenge (45 min) — Students receive a letter from CodeWorks Publishing, a company that is writing a book to teach young children about programming. Students are asked to learn more about programming and to write sample “absent-minded” and corresponding well-thought-out programs to be included at the end of their book.

Lesson 2: Writing Instructions (45 min) — Students explore the everyday challenge of sorting same-colored socks into pairs. They start by breaking down the simplest form of the task—using a fixed number of identical socks—into component steps. In teams, they write instructions for a robot to sort a pile of socks, test their instructions, and share them with the class. They discuss how their instructions could be misinterpreted and think about ways to correct those misinterpretations.

Lesson 3: Looping Loops (45 min) Students review their instructions from the previous session and apply what they learned to a more challenging problem: writing a program for a robot to sort and pair a large (or even unspecified) number of socks. The goal of this activity is to introduce the concept of loops in programming. Students then write a program to explain how to perform a more complex task (such as performing a dance or making s’mores) so other students can follow them.

Lesson 4: If … Then … What? (45-90 min) — Students begin to incorporate decision-making within programs. They revisit the sock-sorting-and-folding challenge, where their robot must decide whether two socks are a match and what to do if they are not. Students practice developing an algorithm that includes decision-making by creating a “guess my number” program.

Lesson 5: Making a Decision (45-90 min)- Students extend their understanding of conditionals to include both if-then-else statements and nested-if statements. They apply their new understanding by updating their algorithms to sort a pile of socks that now includes more than one color. As a class, they discuss different strategies for how to tackle the problem, and update their program using conditionals and loops to complete the task in the optimal way.

Lesson 6: Data Inputs and Outputs (45-90 min) Students formalize some concepts they worked with in the previous activities but have not yet put names to, including variable, input, output, data, and database. After choosing one of three activities, they write a program that includes input, output, and at least one variable.

Lesson 7: Breaking Down the Problem (45-90 min) — Students on breaking down a larger problem into smaller subtasks. They explore several options for how to break down a task and discuss how each strategy is different and under which conditions one algorithm may be more efficient than another.

Lesson 8: Programming Our Absent-Minded Task (45 min) — Students choose their programming tasks for the final CodeWorks challenge and begin to decompose the tasks. They begin to develop their absent-minded programs by combining the various bugs (errors in computer programs that lead to incorrect or unexpected results) that they’ve experienced in previous activities.

Lesson 9: Making Our Program Work (45 min)  Students develop a well-thought-out program to accompany the absent-minded program they developed in Activity 8. They debug their absent-minded programs by looking for places where their code is imprecise or inefficient, and then try to create the best possible programs for their tasks.

Lesson 10: Preparing Our Presentations (45 min)  Teams develop presentations for the two programs they created. Students are reminded how their work will be assessed.

Lesson 11: Presenting Our Projects (45-90 min)  Each team first presents its absent-minded program, complete with an explanation of how the program can go wrong, and then the companion program, with an explanation of why this program will complete the task correctly and efficiently. Students reflect on how their understanding of programming has grown since they began the challenge.

Item Description


LEGO flat tile 1x1 - round "no. 8" (ID: 6029156/13360)


LEGO black brick 1x1 w. 1 knob (ID: 4558954/87087)


LEGO white roof tile 2x1x2 (ID: 4515370/60481)


LEGO black roof tile 2x1x2 (ID: 4515373/60481)


LEGO black roof tile 1x2x2/3, abs (ID: 4548180/85984)


LEGO black plate 2x2 (ID: 302226/3022)


LEGO black plate 1x2 w. 1 knob (ID: 6092585/15573)


LEGO orange brick w/bow 1/3 (ID: 4251969/50950)


LEGO orange plate 1x1 (ID: 4524929/3024)


LEGO black roof tile 2x3/25° inv. (ID: 374726/3747)


LEGO orange plate 2x2 (ID: 4159007/3022)


Ziplock for LEGO




Ziplock for Stopwatch


Opaque drawstring bags


Black socks


Sock pattern/color 1


Sock pattern/color 2


Sock pattern/color 3


Sock pattern/color 4


Wooden Skewers


Cotton Balls


Laminated If-Then-Else cards


Foam graham crackers


Foam chocolate bar pieces


Laminated picture of a fire


Team Portfolio


Science Notebook


PEO Activity / Section Supporting Materials
Activity 1 Preparation; Steps 5-6

Exact Instructions Challenge | How to Make a Perfect Sandwich
In this video (22:55), two young girls in England try to write instructions for their parents to make a ham sandwich. Their mother, who speaks Spanish, translates the instructions into Spanish. The first daughter’s instructions (0:00–3:24) do not result in an edible sandwich. The parents then try the second daughter’s instructions (3:25–6:36), which also do not work. After reworking her directions, Daughter 1’s second try is again a failure (6:37–11:32). Daughter 2’s second try (11:33–15:44) is a success.

Exact Instructions Challenge | Ramen Edition
In this video (8:05), two children write instructions for their father describing how to prepare ramen noodles. In the first segment, the younger child creates two sets of instructions that the father cannot follow correctly (0:50–2:40). In the second part, the father follows the older child’s instructions (2:41–3:56). The younger child then fails again (3:57–4:38). Finally, the group follows instructions sent to them by others.

Exact Instructions Challenge | The Holderness Family
The two children in this family write instructions for tooth-brushing and making toast. The first child’s instructions for brushing teeth do not work (0:55–2:08). The second child’s instructions for making toast (2:09–3:59) also fail. The second child then gives instructions to her mother for brushing her teeth (3:59–5:09). In the last segment, the mother follows the younger child’s instructions for making toast (5:10–5:44).

NOTE: Some of the suggested video segments include instructions for two tasks. You may want to show a portion of those videos depicting only one task, or have students concentrate on just one task when they write instructions later in the activity.

Activity 1, Step 18

What Do Programmers Actually Do?

Activity 2, Preparation and Unplugged Extension

The Easiest Card Trick for Beginners—You Can’t Screw Up!
The trick in this video is intended to be done with two people: the magician and a volunteer from the audience. At about 0:24, the presenter of the video is playing the role of the volunteer. Some students may be confused as to when the presenter is the magician and when he is the volunteer.

For an added challenge, play the video for students without sound.

Make sure to show it at least twice so students have time to write down everything they see

Activity 2, Tech Extensions

Have students try the Basic challenges (Level 1), in which they use command blocks to move around a series of blocks. Note: There are also downloadable versions of this app.

Blockly Games: Maze
Have students try the first two puzzles in the Maze. Programming commands are presented in Blockly the same way that commands are presented in Scratch. Star Wars: Building a Galaxy with Code Blocks
Have students watch the introductory video (2:39), which presents the programming challenge, and then try Puzzles 1–6, which allow them to explore the basic commands available to them (move up, move down, move left, move right). Puzzles 4–6 begin to introduce JavaScript text programming (the language that underlies this app); thus, these puzzles might be more suitable for older students.

Activity 3, Preparation

Box Step Tutorial

Easy Line Dance Tutorial

Hip Hop Dance Moves Tutorial

Activity 3, Step 12, What to Watch For

Row Your Boat with Rounds

Top 5 Rounds/Cannons

Activity 3, Tech Extensions Hour of Code—Mark Zuckerburg Teaches Loops
In this video, Facebook founder Mark Zuckerberg describes how loops improve programming efficiency. Lesson 13: Maze Loops
In this series of challenges, students explore looping using Angry Birds characters and directional blocks. Lesson 14: Bee Loops
Students work with looping while trying to move a cartoon bee to get nectar and make honey. Lesson 13: Maze Loops offers a similar challenge.)

Have students try the Loops challenges (Level 3), in which they move around a series of blocks using command blocks. In this level, they can create a process (PROC1) that can be run over and over in the main program. Note: There are also downloadable versions of the app.

Blockly Games: Maze
Have students try Puzzles 3–5 in the Maze. Programming commands are presented in Blockly the same way that commands are presented in Scratch. Puzzle 3 introduces a “repeat until” block. Dance Party
Students can use to create their own online dance programs.

Activity 4, Tech Extensions Hour of Code—Bill Gates Explains If Statements
Bill Gates uses clear examples to illustrate “if” statements. Lesson 11: Conditionals in Bee
In this series of challenges, students explore conditionals while moving a bee around to find nectar.
   NOTE: To find similar lessons at, search for “ bee conditionals.”

Blockly Games: Maze
Have students try Puzzles 6–10 in the Maze. Programming commands are presented in Blockly the same way that commands are presented in Scratch. Puzzle 6 introduces an “if path . . . do” block.

Activity 4, Background, Sorting

Bubble Sorts
This site offers videos and helpful explanations of bubble sorts.

LEGO Bubble Sort
This video of LEGO towers and LEGO people shows a bubble sort in a very understandable way for young children.

Insertion Sort, Kahn Academy
Using a card game as an example, this site offers step-by-step instructions and a simulation on how to do an insertion sort.

Visualization and Comparison of Sorting Algorithms
This wordless video, best for use with older children, provides a visual representation of various sorting algorithms, demonstrating the speed that they are able to achieve. The sorting algorithms include selection sort, shell sort, insertion sort, merge sort, quick sort, heap sort, bubble sort, comb sort, and cocktail sort.

Activity 5, Tech Extension Coding: Conditionals provides educational hip-hop videos that explore standards-based skills and content. Show students the Coding: Conditionals video, which explores conditionals in programming.

Activity 9, Tech Extensions Lesson 5: Maze: Debugging
In this series of challenges, students explore debugging while moving Angry Birds around the screen.

This application teaches computer programming concepts through debugging puzzles. In the game, Gidget the robot was damaged on its way to clean up a chemical spill and save the animals. Players are asked to fix the malfunctioning code to allow Gidget to function properly.
NOTE: The Gidget application may be more suitable for older students.