Lesson 4: Programming with Angry Birds

Overview

Using characters from the game Angry Birds, students will develop sequential algorithms to move a bird from one side of a maze to the pig at the other side. To do this they will stack code blocks together in a linear sequence, making them move straight, turn left, or turn right.

Purpose

In this lesson, students will develop programming and debugging skills on a computer platform. The block-based format of these puzzles help students learn about sequence and concepts, without having to worry about perfecting syntax.

Agenda

Warm Up (4 min)

Bridging Activity - Programming (10 min)

Previewing Online Puzzles as a Class (3 min)

Main Activity (30 min)

Wrap Up (5 - 10 min)

Extended Learning

View on Code Studio

Objectives

Students will be able to:

  • Translate movements into a series of commands.
  • Identify and locate bugs in a program.

Preparation

  • Play through the puzzles to find any potential problem areas for your class.
  • (Optional) Pick a couple of puzzles to do as a group with your class.
  • Make sure every student has a journal.

Links

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

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.
  • Sequencing - Putting commands in correct order so computers can read the commands.

Support

Report a Bug

Teaching Guide

Warm Up (4 min)

Review Unplugged Activity

This lesson relies on many of the unplugged ideas that students have learned in the weeks leading up to this first online activity. It is important that you bring those concepts (such as persistence, debugging, algorithms, and programs) around full-circle so that your class can benefit from them in their online work as well.

Display: Show students a cup stack from the "My Robotic Friends" exercise that they completed in the lessons prior to this one.

Discuss: Ask students to recall the symbols used in "My Robotic Friends."

  • What happens when the robot reads the different arrows?

Encourage students to think about the debugging tips:

  • Was everything right at the first step?
  • How about the second?
  • Where did it go wrong?

Transition: Once you are satisfied that your students remember "My Robotic Friends", you can move into the Bridging Activity.

Bridging Activity - Programming (10 min)

Transitioning from Unplugged to Online

This short activity will help students relate the ideas of persistence and debugging to the puzzles that they are about to complete online.

Display: Project a copy of the Course C, Lesson 2 Maze Bridging Page - Puzzle Manipulative (PDF) for the class to see. Make sure that you have pre-placed the movement blocks in the workspace using Unplugged Maze Blocks - Manipulatives in a configuration like the one below:

Model: Tell students that you have this workspace on display that looks just like the area that they will see when they start to do the Code.org puzzles online. As the teacher, let them know that you are SO SMART that you already put all of the code in that you are going to need to solve this puzzle, then ask them to watch you "Run" it by moving your finger (or a penny, or some other indicator) along the path.

It won't be long before you run into a block of TNT. Feign frustration.

Discuss: - What am I feeling right now, do you think? - Should I quit? - Should I throw all of the code away and start over?

Think: How can I fix this program so that I don't run into the TNT?

Pair: Have students work on solutions to get the bird around the TNT. Depending on your classroom, you might want to either have them fix each mistake one at a time (with demos in between) or students might feel comfortable working together to fix the entire program.

Share: Have volunteers come up to help move the blocks into the right location. "Run" the program over and over as a class, fixing bugs, until the bird does what it is supposed to. Continue to point out experiences that relate to persistence, frustration, and debugging.

When your class reaches the pig, celebrate not only their achievements, but their persistence!

Previewing Online Puzzles as a Class (3 min)

Students should now be ready to see a real puzzle in action!

Lesson Tip

Some students may struggle with turning their bird in the correct direction, particularly when the bird isn't facing up. Remind students that when we say turn left or right, we're giving directions from the bird's point of view.

Model: Pull up Puzzle 5 to do in front of the class. This will be the same puzzle that they just saw in the bridging activity. While working through this puzzle with the class, remind students that making mistakes is okay and remind them that the only way to be successful is to be persistent.

Discuss: Does anyone remember how to solve this puzzle?

As the teacher, you should decide if you will have the students remind you how to solve it from their seats, or come to the computer to drag the actual blocks in one-by-one.

Transition: Now that students have seen an online puzzle in practice, they should be ready to start solving puzzles of their own. Continue to the lab or bring out their classroom machines.

Main Activity (30 min)

Online Puzzles

Teacher Tip:

Show the students the right way to help classmates:

  • Don’t sit in the classmate’s chair
  • Don’t use the classmate’s keyboard
  • Don’t touch the classmate’s mouse
  • Make sure the classmate can describe the solution to you out loud before you walk away

Circulate: Teachers play a vital role in computer science education and supporting a collaborative and vibrant classroom environment. During online activities, the role of the teacher is primarily one of encouragement and support. Online lessons are meant to be student-centered, so teachers should avoid stepping in when students get stuck. Some ideas on how to do this are:

  • Utilize pair programming whenever possible during the activity.
  • Encourage students with questions/challenges to start by asking their partner.
  • Unanswered questions can be escalated to a nearby group, who might already know the solution.
  • Remind students to use the debugging process before you approach.
  • Have students describe the problem that they’re seeing. What is it supposed to do? What does it do? What does that tell you?
  • Remind frustrated students that frustration is a step on the path to learning, and that persistence will pay off.
  • If a student is still stuck after all of this, ask leading questions to get the student to spot an error on their own.

Discuss: After providing students with end-of-class warnings, grab everyone's attention and get them to reflect on the experiences that they just had.

  • Did anyone feel frustrated during any of the puzzles?
  • Did anyone notice the need to be persistent?

Transition: Have students grab their Thinkspot Journals and take a moment to leave lessons for themselves.

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 an activity you like to do that you struggled with the first time. Draw or describe how you got better.

Extended Learning

Use these activities to enhance student learning. They can be used as outside of class activities or other enrichment.

Create Your Own

In small groups, let students design their own mazes and challenge each other to write programs to solve them. For added fun, make life-size mazes with students as the pig and bird.

  • Maze Intro: Programming with Blocks
  • 1
  • (click tabs to see student view)
View on Code Studio

Student Instructions

For this puzzle, drag all of the blocks together and click "Run" to watch it go!

View on Code Studio

Student Instructions

Drag an extra move forward block out of the toolbox to finish your code.

View on Code Studio

Student Instructions

"This pig is ruffling my feathers."

There is one extra block that is going to cause the bird to crash.
Throw it away by unhooking it from the grey blocks and dragging it back to the toolbox.

View on Code Studio

Student Instructions

"Trace the path and lead me to the silly pig."

Avoid TNT or feathers will fly!

View on Code Studio

Student Instructions

"Follow this path to get me to the pig!"

Avoid the TNT.

View on Code Studio

Student Instructions

"Keep calm and help me find the bad pig. Otherwise I might get angry!"

Get the bird to the pig and avoid the TNT.

  • Challenge
  • 8
  • (click tabs to see student view)
View on Code Studio

Student Instructions

"It's time to get angry!"

Challenge: This code has a lot of bugs. You'll need to remove some blocks and add others.

  • Practice
  • 9
  • (click tabs to see student view)
View on Code Studio

Student Instructions

"Keep calm and help me find the bad pig."

  • Predict
  • 10
  • (click tabs to see student view)
View on Code Studio

Student Instructions

Read through the code below very carefully. What will happen when you click "Run"?

The bird will end up one step short of the pig.

The bird will make it to the pig.

The bird will run into the TNT.

I don't know.

  • Practice
  • 11
  • (click tabs to see student view)
View on Code Studio

Student Instructions

"Now, help me sneak up on the pig any way you want to!"

View on Code Studio

Student Instructions

The bird needs your help! The pig is hiding, and the goal is to find it.

View on Code Studio

Student Instructions

Sometimes there is more than one way to solve the same problem. Sometimes it's faster to go backwards than it is to go forwards!

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