Lesson 3: Programming with Angry Birds
52 minutes
Overview
In this skill-building lesson, 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.
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.
Agenda
Objectives
Students will be able to:
- Identify and locate bugs in a program.
- Translate movements into a series of commands.
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.
Links
Heads Up! Please make a copy of any documents you plan to share with students.
For the teachers
- CSF - Course C - Slides 2022-2023 - Slides (Download)
For the students
- Maze Bridging Page
- Unplugged Maze Blocks - Manipulatives
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.
Teaching Guide
Warm Up (4 minutes)
Reflect
Display: Show “Reflect” slide
Reflect: Why is it important to give a robot specific instructions when you “program” it?
Vocabulary
Display: Show “Vocabulary” slide
- 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.
Introduction
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 “Discuss” slide
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?
Display: Show “Debugging Tips” slide
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 minutes)
Transitioning from Unplugged to Online
Display: Show “Bridging Activity” slide
This short activity will help students relate the ideas of persistence and debugging to the puzzles that they are about to complete online.
Display: Show “Maze Bridging” slide
Display: Project a copy of the *Maze Bridging Page for the class to see. Make sure that you have pre-placed the movement blocks in the workspace using *Maze Blocks in a configuration like the one below (this is already configured for you on the slide):
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?
Use the blocks provided on the slide and drag them into the work area to demonstrate student solutions.
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 minutes)
Students should now be ready to see a real puzzle in action!
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.
Display: Show “Preview Online Puzzle” slide
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 computers.
Main Activity (30 minutes)
Programming with Angry Birds
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
Display: Show “Maze Intro: Programming with Blocks” video
Display: Show “Level 2-7 - Skill Building” slide
Display: Show “Level 10 - Prediction” slide
Display: Show “Lesson Extras” slide
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.
Display: Show “Discuss” slide
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 take a moment to reflect on the lesson for themselves.
Wrap Up (5 minutes)
Reflection
Display: Show “Reflect” slide
Reflect: Why is it important to program your blocks in a specific order?
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.
Cross-Curricular Opportunity
Bugs, Bugs & More Bugs (45-60 minutes)
Computer Science + English Language Arts + Math
Bugs, Bugs & More Bugs is an optional activity aligned to Common Core ELA and Math standards, written by our teacher community. Students will practice debugging as they fix code, correct a math problem and proofread writing samples.
Standards Addressed:
-
CCSS.ELA-LITERACY.L.2.1.B: Form and use frequently occurring irregular plural nouns (e.g., feet, children, teeth, mice, fish).
-
CCSS.ELA-LITERACY.L.2.2.A: Capitalize holidays, product names, and geographic names.
-
CCSS.ELA-LITERACY.L.2.2.C: Use an apostrophe to form contractions and frequently occurring possessives.
-
CCSS.MATH.CONTENT.2.OA.B.2: Fluently add and subtract within 20 using mental strategies.
-
CCSS.MATH.CONTENT.2.NBT.A.4: Compare two three-digit numbers based on meanings of the hundreds, tens, and ones digits, using >, =, and < symbols to record the results of comparisons.
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.