Codespark
Codespark
1
codeSpark Teacher’s Guide
Thank you for your interest in teaching computer science to your kids! Knowledge of
computer science and “algorithmic thinking” is increasingly necessary for success in
our digital world. This skill is becoming a critical component of 21st century literacy.
codeSpark created The Foos as an introduction to the “ABCs of Computer Science.”
While it’s important to prepare kids for the modern workplace, computer science is
about much more than getting a job in high tech. Research shows that computer
science helps students improve in core areas like math, logic, and even reading
comprehension. Often people think of programming or coding as computer science
but that is just one element. At its core, computer science is the study of how to use
logical thinking to identify, simplify and solve complex problems, not 0’s and 1’s.
Studies from MIT and Tufts University show that students as young as five can learn
complex computer science concepts, especially when artificial barriers like
programming syntax are out of the way.
By playing our games, your students will improve their critical thinking skills, and
improve in other disciplines, all while having a lot of fun!
!2
Table of Contents
Computer Science for K - 5
4 Overview
11 Lesson 1: Sequencing
23 Lesson 2: Flexible Sequences
36 Lesson 3: Commands & Parameters
40 Lesson 4: Events
51 Lesson 5: Loops
63 Lesson 6: Efficiency
73 Lesson 7: Endless Loops
80 Lesson 8: Conditionals Statements I
87 Lesson 9: Conditionals Statements II
91 Lesson 10: Debugging
98 Worksheets
144 Glossary
145 Rubric
146 References
147 Acknowledgements
!3
OVERVIEW
Computer Science for K - 5
Teacher Overview:
Our ten lesson plans provide a fun, flexible and engaging introduction to foundational
computer science concepts. They target students in K – 3rd grade, but we’ve
successfully tested with students as old as 8th grade.
These lesson plans are meant to be highly adaptable. We often suggest variations
within the plans themselves. You will be the best judge of what your students need to
spend more time on and what they seem to enjoy the most.
In addition, most lessons include both an activity with our game, The Foos, and an
“unplugged” activity that does not require a computer or other connected device.
Materials:
Our game, “The Foos" – Code for an Hour. Download it at thefoos.com
Available for FREE on iPad, iPhone, Android Devices and web (e.g. major
browsers Chrome, Safari, IE, etc.)
No experience is necessary, but we recommend you review the lessons and play a
few levels of the game prior to teaching it for the first time.
!4
OVERVIEW
Computer Science for K - 5
• everyday processes like getting ready for school or making toast can be thought
of as a set of instructions (ex. Get bread, put in toaster, toast… etc)
• computer scientists mostly work in teams, not alone. Teams are generally better
at finding creative solutions to problems than individuals
• “Test and learn” strategies for problem solving are generally the best. Making
mistakes is always part of the journey to the right answer
The first lesson focuses on identifying common objects that only work when given
the proper instructions. Then we will put this idea to work by programming the Police
Foo – the first character players meet in our game.
!5
OVERVIEW
Computer Science for K - 5
Each Foo can walk, jump, throw, eat and navigate their world, called “Fooville.” Some
Foos have special abilities that make them unique, for example:
But, just like computers, the Foos only do what they are told. Students must learn to
give them specific commands, or program the Foos, in a specific order.
Look out! The blue character with the white horns is the Glitch. He
is a force of chaos in Fooville. Sometimes he makes a mess,
sometimes he throws things around and sometimes he appears
unexpectedly.
!6
OVERVIEW
Computer Science for K - 5
Most importantly, Foos are really, really fun to play with! This means students get
deeply engaged with sophisticated concepts and look forward to learning more and
testing their knowledge of the game and of programming. Computer Science quickly
becomes a favorite subject!
• Computer Science is just for boys - Ada Lovelace is considered to be the first
computer programmer. The first all electronic computer was programmed by 6
women.
!7
OVERVIEW
Computer Science for K - 5
!8
OVERVIEW
Computer Science for K - 5
Profile
Minigames
Puzzle Levels
Tutorial Foo
Levels Store
!9
OVERVIEW
Computer Science for K - 5
(circled).
Reset your progress:
To reset your progress go to the profile screen (in the Main Selection) you can make a
new profile. If you already have three profiles you can delete one.
!10
Lesson 1
Sequencing
The Foos Chapter 1
Time:
45-60 Min
Materials:
Tablets or Computers with The Foos
A pencil for each student
Story Sequence 1 & 2 handouts
Learning Goals:
Understand that computers are powerful, but need help to work.
- They only do what they are told, in the specific order instructions are received.
- Figuring out what instructions to give computers can be tricky.
Accustom students to using “test and learn” strategies for problem solving.
- “Making mistakes is always part of the journey to the right answer.”
Vocabulary:
Programming: Creating a sequence of instructions, or an algorithm, that makes a
computer do something
!11
Lesson 1
Sequencing
The Foos Chapter 1
Introduction:
Begin with a group discussion of the computers that are around us. Some look like
laptops, others might be cell phones, projectors, or thermostats.
Discuss some “instructions” we give to these computers and what they do. For
example, we can tell calculators to add or our cellphones to make phone calls.
Introduction (cont.):
In computer science, we use the word algorithm to describe the instructions we give
computers to solve problems. The specific order of those instructions is called a
sequence.
Ask students to think about the algorithm to get ready for school in the morning.
“What if you put your coat on before your clothes? Your shirt and pants would be on
top of your coat, which is just silly!“. When we write algorithms, the order of
instructions is really important.
Introduce the “Test and Learn” strategy to solving problems, which students can use
as they play “The Foos.”
!12
Lesson 1
Sequencing
The Foos Chapter 1
Step 1 : Understand
the problem
Did you solve the Test and Learn What do you want The
problem? Foo to do?
Write an algorithm
Step 3: Test the plan you think would fix
the problem
What happened when you
tested your algorithm?
!13
Lesson 1
Sequencing
The Foos Chapter 1
Game Activities:
Let students explore and play the first eight (8) levels (Police Foo).
If students have difficulty with the game, reinforce the “Test and Learn” strategy for
problem solving.
Unplugged Activity:
1. Put students into pairs.
3. Have each pair work together to identify which picture comes first, second,
third, etc. in the story and have them put a number next to each picture to
identify the order of events.
ProTip: Encourage students to use the Test and Learn Strategy (pg. 11) throughout
the codeSpark curriculum. This will help develop their problem solving skills and
persistence. You can also try out the strategy in other classroom activities as well!
Next page is an answer guide for Story Sequences 1 & 2.
!14
Lesson 1
Sequencing
The Foos Chapter 1
2 1
!15
Lesson 1
Sequencing
The Foos Chapter 1
Answer Key
2 3 1
Number the boxes in the
correct order
2 1
!16
Lesson 1
Sequencing
The Foos Chapter 1
Answer Key
2 4
1 3
1 2
4 3
!17
Lesson 1
Sequencing
The Foos Chapter 1
How to Solve:
2 1 x
Number the boxes Write an X in the
in the correct order. box if it doesn’t
belong.
Answer Key
1 Number the boxes in the correct order and write an X in the box
if it doesn’t belong.
3 2
X 1
!19
Lesson 1
Sequencing
The Foos Chapter 1
Answer Key
2 Number the boxes in the correct order and write an X in the box
if it doesn’t belong.
3 2
1 X
5 4
!20
Lesson 1
Sequencing
The Foos Chapter 1
Answer Key
3 Number the boxes in the correct order and write an X in the box
if it doesn’t belong.
1 X
3 4
2 5
!21
Lesson 1
Sequencing
The Foos Chapter 1
Debrief Discussion:
• What was the most challenging part of the Story Sequence activities?
• Brainstorm other everyday algorithms (e.g., getting ready for bed, the class’ daily
schedule).
• If time allows, try writing them out on the board to see if the order makes sense.
!22
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Time:
45-60 Min
Materials:
Tablets or computers with The Foos
Pencils and paper
Flexible Sequence 1 & 2
Learning Goals:
Understand that actions must happen in a specific order to complete a task.
Vocabulary:
Sequence: The step-by-step order in which instructions should occur.
Introduction:
Discuss how some sequences are more flexible than others.
Ask students if they can think of any flexible sequences in their morning routine.
(Perhaps they brush their teeth then eat breakfast or brush their teeth after eating
breakfast).
!23
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
More examples: (order they would start to clean their room, order to put on their
clothes, order they hug their stuffed animals)
Introduction (cont):
Some sequences are completely flexible while others require certain beginning and
end points (such as getting up and going to school, this sequence will always begin
with waking up and it will always end with arriving at school). Reinforce that some
sequences are only semi-flexible.
Game Activities:
Replay levels 5-8 to reinforce programming and sequencing logic.
Play Chapter 2: Builder Foo levels 9-12.
Ask students if they think the Foos contain flexible sequences? It does!
Encourage students to try different sequences to retry or get 3 stars in their already
finished levels.
!24
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Unplugged Activity:
1. Divide students into pairs.
2. Hand out a pencil and Flexible Sandwich Sequence handout to each pair.
3. Have pairs solve the sandwich sequences as they did in Lesson 1, but reiterate
that with these, there is not necessarily a “correct” order.
4. Have pairs share their solutions with another pair to see how their sequences
differ.
5. For an extra challenge, have pairs try the Flexible Story Sequence Handout.
ProTip: Paired Programming - If some of your students finish early, have them help
other students who are still working. You can also pair up students at the beginning,
where one person “drives” by controlling the mouse, keyboard, or touchscreen and the
other person “navigates” by answering the driver’s questions and pointing out
potential problems or mistakes.
!25
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
How to Solve:
Number the boxes in the order Chef should combine these
ingredients. There are mutiple correct answers!
1 4 3 2
!26
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Answer Key
1 Number the boxes in the order Chef should combine these ingredients.
1 3 2
Number the boxes in the order Chef should combine these ingredients.
2 There are many correct answers!
1 4
Bread Bread
Flexible Flexible
!27
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Answer Key
3 Number the boxes in the order Chef should combine these ingredients.
There are many correct answers!
Flexible
Bread Mayo
Flexible
Ham Bread
Flexible
Cheese
!28
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Answer Key
4 Number the boxes in the order Chef should combine these ingredients.
There are many correct answers!
Flexible
Bread Mayo
Flexible
Ham Bread
Flexible
Flexible
Cheese Turkey
!29
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
How to Solve:
Number the boxes in the correct order.
(there are mutiple correct answers)
1 4
Some Events must come first Some Events must come last
!30
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Answer Key
1 4
Flexible Flexible
!31
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Answer Key
2 Put the pictures in the correct order.
(there are mutiple correct answers)
1 Flexible
Flexible Flexible
6 Flexible
STOP
!32
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Answer Key
Flexible 6
1 Flexible
Flexible Flexible
!33
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Answer Key
4 Put the pictures in the correct order.
(there are mutiple correct answers)
1 Flexible
Flexible Flexible
Flexible Flexible
8
Flexible
STOP
!34
Lesson 2
Flexible Sequences
The Foos Chapter 1 & 2
Debrief Discussion
• Did any pairs have different story sequences? Were both sequences correct? Why
or why not?
• If you were building a sandwich robot, what part of sandwich building would be
easiest to automate? What would be hardest? Why?
!35
Lesson 3
Commands & Parameters
The Foos Chapter 2 & 3
Time:
45-60 min
Materials:
Tablets or computers with “The Foos"
1 set of the Commands & Parameters cards for each student
Pencils and paper
Learning Goals:
Learn what commands are and how they can be modified with parameters.
Learn that commands are the primary instruction while parameters are the details –
For example “walk” is a command and “left” is a parameter.
Vocabulary:
Command: primary instructions that tells the computer what action to perform (e.g.,
run, jump, walk)
Parameter: details of instructions that adds more specific information about the
command (e.g., direction, color, object to perform an action on)
Introduction:
Introduce the concepts of commands and parameters by asking the class to tell you
the directions to get from your classroom to the library. Tell students to be specific
and make sure to include things like the direction (left, right, up, down).
!36
Lesson 3
Commands & Parameters
The Foos Chapter 2 & 3
Write out the directions on the board and reinforce that the directions are a type of
algorithm telling you how to get from the classroom to the library . Circle any
commands they give you and underline any parameters. Are there similarities with
words that are circled and words that are underlined?
Introduction (cont.):
Explain that sequences must include commands that tell you what action to do and
parameters that add more specific information about how the action should be done.
Game Activities:
Complete all levels in Chapter 2: Builder Foo
Go onto Chapter 3: Ninja Levels (reinforcement levels)
After the game ask students to name some of the commands in the Foos. Then have
them try to name some of the parameters (reinforce the differences between the
two).
!37
Lesson 3
Commands & Parameters
The Foos Chapter 2 & 3
Unplugged Activity:
1. Divide students into pairs.
4. Using these cards, each group tries to create as many programming instructions
as possible in 5-10 minutes.
- Remind students that a programming instruction must include a command and
a parameter.
- Combine a command card and a parameter card to create a single instruction.
- Record each unique instruction that students create on the paper.
5. After 5-10 minutes, count how many unique instructions each group created.
ProTip: Debriefing - Gathering the class as a whole group to debrief the lesson helps
students to reflect on their learning. Debrief Discussions are also intended as a time
to relate the lesson content to the real-world and make computer science relevant to
students’ everyday lives.
!38
Lesson 3
Commands & Parameters
The Foos Chapter 2 & 3
CHANGE
BLOW UP RED BLUE
COLOR
STRAIGHT
CHASE THROW APPLE
UP
CHANGE
BLOW UP RED BLUE
COLOR
!39
Lesson 4
Events
The Foos Chapter 4
Time:
45-60 min
Materials:
Tablets or computers with “The Foos"
Crayons
Remote map handout for students
Master copy with directions for remote control map activity
Learning Goals:
Understand that events allow us to have options in algorithms. They are not pre-
determined but cause things to happen only when the event occurs.
Vocabulary:
Event: an action or cue that signals a new line of code to run.
For example:
- When a student raises their hand (the event), you call on them (resulting action of
the event).
- When the alarm clock goes off (the event), you wake up (resulting action of the
event).
Introduction:
Introduce the concept of events by telling students you are going to ask them a
question and you want them to raise their hand if they want you to call on them for
the answer.
!40
Lesson 4
Events
The Foos Chapter 4
Then ask a simple question that most students will be able to answer:
What is the color of my hair?
What is the weather today?
What day of the week is it?
Introduction(cont.):
Call on a student who has a hand raised and let him/her answer the question. Then
ask the class how you knew the student wanted you to call on him/her.
The class should mention that the student raised his/her hand.
Explain that when the student raised his/her hand, it is an event because it was an
action that prompted something else to happen--you calling on the student.
Ask the class if they can think of any other types of everyday events. You might need
to clarify that you are not talking about events in the conventional sense, like a
birthday party or a sports game. In computer science, events are actions that cause
something else to happen.
- If you have a call and response to get the student’s attention, your “call” is the
event and their response is the resulting action (e.g., you clap three times and the
class claps once to let you know they are paying attention; you turn the lights off
and the class becomes quiet).
- When the alarm clock goes off (the event), you wake up (resulting action of the
event).
- When the street light turns green (the event), cars start driving (resulting action of
the event)
- When you click the power button on a computer (the event), the computer turns on
(resulting action of the event).
!41
Lesson 4
Events
The Foos Chapter 4
ProTip: Clarifying Events - If students are confused about events, ask them to
think about their favorite game and the ways in which they let the character
know what to do. You can also bring up “The Foos" to show them a specific
example. Point out that if there were no events in the entire game, it would be
really boring to play.
Game Activities:
Astronaut level 25-29
Ask: Which parts of the code were events? How do you know?
!42
Lesson 4
Events
The Foos Chapter 4
1. Touch event: When you click on, or touch, the Foo (the event), the code runs
(resulting action of the event).
2. Play event: When you click the play button (the event), the code runs (resulting
action of the event).
!43
Lesson 4
Events
The Foos Chapter 4
3. Bump event: When the Foo bumps into something, like the towers in Chapter 4
(the event), the code runs (resulting action of the event).
4. Shout/Hear event: When the Foo hears something, like an order for pasta in
Chapter 5 (the event), the code runs (resulting action of the event).
!44
Lesson 4
Events
The Foos Chapter 4
Unplugged Activity:
1. Hand out a colored crayon and a Map handout to each student. Make sure
you have the master copy of the handout with the directions.
2. Tell the class that you aren’t allowed to “say” the location of the treasure
but you can tell them through Events.
4. Start the activity by telling students to put their crayon on the center of
their maps. Then follow the directions provided in the master copy of the
map handout. Make sure to pause in between each line of directions so
students have time to move crayons and so they understand when two
lines of consecutive directions have the same action (e.g., when you want
students to move left two squares, you stomp your feet and then stomp
your feet again).
5. When you finish going through each activity, all students should end at the
same point on the map. Answer sheet and the shape the students draw
should match.
7. Feel free to add in your own directions to make the game more
challenging.
Next page is an answer guide for Events handout.
!45
Lesson 4
Events
The Foos Chapter 4
How to decode:
Hand Clap Event… Go Right one space on the chart.
!46
Lesson 4
Events
The Foos Chapter 4
Answer Key
Directions:
!47
Lesson 4
Events
The Foos Chapter 4
Answer Key
Directions:
!48
Lesson 4
Events
The Foos Chapter 4
Answer Key
Directions:
!49
Lesson 4
Events
The Foos Chapter 4
Debrief Discussion:
• What were the events in the map activity? What were the resulting actions?
• Why do you think events are important for computer programs (hint: provide
options for users so not everything is completely predetermined)?
!50
Lesson 5
Loops
The Foos Chapter 2 & 3
Time:
45-60 min
Materials
Tablets or computers with “The Foos"
Pencils
Loops 1 & 2 Handouts
Learning Objectives:
Understand why a loop is powerful
Understand that some sequences are more efficient, and thus more desirable, than
others.
Efficiency is important because computers don't have unlimited processing power.
Recognize everyday routines that might benefit from a loop command.
Recognize the use of loops in favorite video games.
Vocabulary:
Loop: A set of instructions that is repeated over and over again.
Introduction:
Introduce the concept of loops by brainstorming examples of everyday activities that
include repeated actions, or loops.
Explain that loops help make code more efficient since computers only have so much
power. Write the name of an activity and the steps or loops to complete it.
!51
Lesson 5
Loops
The Foos Chapter 2 & 3
Introduction (cont.):
Examples:
- Washing Hands: Wet hands — Soap hands — LOOP: (Rub hands, 3 times) – Rinse
hands
- Brushing teeth: Squeeze paste — wet brush — LOOP: (brush teeth, 10 times) —
spit — Rinse — brush
Game Activities:
Have the students play Chapter 2 episode 10 when the loops gets introduced.
Have students replay the rest of the Chapter 2 levels. Can they use a loop Loop
on every level?
Does this generally make their programs smaller (e.g. do they use fewer total
commands to solve the puzzle)?
!52
Lesson 5
Loops
The Foos Chapter 2 & 3
Unplugged Activity:
1. Divide students up into pairs.
!53
Lesson 5
Loops
The Foos Chapter 2 & 3
Looping Activity 1
Answer sheet! Activities in back of the book!
How to Solve:
Give Police Foo the right loop command to reach the
Donut square.
!54
Lesson 5
Loops
The Foos Chapter 2 & 3
Answer Key
1
Help Police Foo reach the Donut Square!
!55
Lesson 5
Loops
The Foos Chapter 2 & 3
Answer Key
3
Help Police Foo reach the Donut Square!
4
Oh no! The arrow is missing !
write the correct arrow in the blank
!56
Lesson 5
Loops
The Foos Chapter 2 & 3
Looping Activity 2
Answer sheet! Activities in back of the book!
3 2
!57
Lesson 5
Loops
The Foos Chapter 2 & 3
Answer Key
Help Astronaut Foo reach the Puppy Square!
1
2
Help Astronaut Foo reach the Puppy Square!
2 2
!58
Lesson 5
Loops
The Foos Chapter 2 & 3
Answer Key
4 3
!59
Lesson 5
Loops
The Foos Chapter 2 & 3
Answer Key
Help Astronaut Foo reach the Puppy Square!
4
4 3
!60
Lesson 5
Loops
The Foos Chapter 2 & 3
Answer Key
Help Astronaut Foo reach the Puppy Square!
5
3 2
!61
Lesson 5
Loops
The Foos Chapter 2 & 3
Debrief Discusion:
• What are the benefits of using loops?
• What are some classroom activities that we could write as an action sequence with
loops? (If time allows, write the sequences on the board).
ProTip: Real Life Loops - To help students better understand loops, have them play
these games and see if they can identify where the loops are: “Temple Run,” “Subway
Surfer,” and “Minion Rush.”
!62
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Time:
45-60 min
Materials:
Tablets or computers with “The Foos"
4 different colored crayons
Foos Patch Quilt Handout
Learning Goals:
Practice making programs more efficient.
Understand the concept of efficiency and that the best programs are the most
efficient
Efficient programs use the fewest commands
Vocabulary:
Efficient programs: Programs that respond more quickly and take less memory and
power
Introduction:
On the board, draw an A on one side and a B on the other. Then draw a straight line
from point A to point B and in a different color, draw a curved line with ups and downs
but still goes from point A to point B.
Tell students that your car is running out of gas and you need get from Point A to the
gas station before you run out. Which line should you take (answer: straight line)?
Ask students why taking the straight line would be better.
!63
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Point out that the straight line is the shorter route and would take up less gas so you
would be less likely to run out of gas before you got to the gas station.
Introduce the concept of efficiency and note that in the driving example, straight line
was more efficient because it got you from point A to point B the quickest.
Explain how in computer science, we also want to be efficient when we write code.
The most efficient code is always desirable because computers don't have unlimited
processing power just like we don’t have unlimited amounts of gas to drive from point
A to B.
The “best solution” generally involves the fewest commands, but sometimes it’s quite
challenging to write a short program and creativity is required to solve the problem.
Game Activities:
Have students replay The Foos Chapter 3 & 4.
Does the number of stars you receive mean your code was more efficient?
!64
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Unplugged Activity:
Pass out crayons and the Foo Patch Quilt handout. Students should have access to a
variety of crayon colors.
• The Foos don’t want any patches that touch to be the same color.
ProTip: The Four Color Theorem - Did you know that you only need four different
colors to color a map with no adjacent regions having the same color? This is called
the Four Color Theorem and is the basis behind the Foos Patch Quilt activity. Have
your students test out the theorem with larger maps.
!65
Lesson 6
Efficiency
The Foos Chapter 3 & 4
!66
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Answer Key
Color in the Quilt
1 Use the fewest color crayons possible.
One patch can not be the same color as one next to it.
!67
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Answer Key
Color 1
Color 1 Color 1
Color 2 Color 2
Color 2 Color 2
Color 2 Color 2
Color 2 Color 2
Color 1 Color 1 Color 1
!68
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Answer Key
Color 1 Color 3
Color 2 Color 1
Color 3 Color 2
Color 1
Color 3
Color 2
Color 1
Color 2
Color 3 Color 1
!69
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Answer Key
Color 2 Color 1
Color 1 Color 2
Color 2 Color 1
Color 2 Color 1
Color 2
Color 1
Color 1
Color 2
!70
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Answer Key
Color in the Quilt
5 Use the fewest color crayons possible.
One patch can not be the same color as one next to it.
Color 2
Color 3
Color 1
Color 2
Color
1
Color 3
Color 2
Color 1
!71
Lesson 6
Efficiency
The Foos Chapter 3 & 4
Debrief Discussion:
• When playing “The Foos”, what sequences were most efficient? Why? What
commands helped make the sequences efficient (e.g., loops)?
• How many colors did you use to color the quilt? Did anyone use fewer colors?
• Can you think of other everyday activities where we want to be efficient?
- Turning off the water when brushing teeth is efficient because it helps save
water.
- Taking the shortest route to school is efficient because you get to school faster
and save time and gas!
!72
Lesson 7
Endless Loops
The Foos Chapter 4
Time:
45-60min
Materials:
Tablets or computers with “The Foos”
Command and Parameter Dance Cards
Rules for Whoosh ball
Learning Goals:
Understand the difference between a loop and an endless or infinite loop
Understand how an event can interrupt an endless loop, but once this event is over,
the loop continues
Vocabulary:
Endless loop: A set of instructions that is repeated over and over again without end.
Introduction:
Review the topic of basic loops and why loops are beneficial (hint: they make code
more efficient).
Introduce the concept of endless loops and provide some examples: the earth
rotating around the sun, time, electricity.
!73
Lesson 7
Endless Loops
The Foos Chapter 4
When writing code we can include events that interrupt an endless loop and cause
something else to happen. But once the event is over, the endless loop continues.
Introduction (cont.):
Example:
- Electricity is an endless loop, but when you flip the light switch, it temporarily shuts
off until the light switch is turned on again.
- Teach students “This is the song that never ends” as an example of an endless
loop.
Game Activities:
Have students play “The Foos," Chapter 4, Level 27 with the Astronaut Foo.
!74
Lesson 7
Endless Loops
The Foos Chapter 4
Set to infinite
The infinity sign at the bottom of the command has the Astronaut moving endlessly
to the right.
Ask students to come up with a solution for the level that does not require an infinite
loop.
After they’ve completed the level ask them if they think using the infinite loop was
better?
!75
Lesson 7
Endless Loops
The Foos Chapter 4
Unplugged Activity 1:
1. Divide students into pairs and provide each pair with Command and Parameters
Dance Cards (see examples on the next page).
2. In pairs, have students use the cards to create their own dances. There are two
rules for dance:
- The dance must be contained within a endless loop.
- It must include at least one command and one parameter.
3. Have pairs write down the sequence of actions and the parameters that make up
their dance.
4. Have each pair present their dance to the whole class (act it out!) and ask the
other students to identify what were the commands and parameters of the dance
loop.
!76
Lesson 7
Endless Loops
The Foos Chapter 4
TURN
CLAP ONCE TWICE
AROUND
SNAP
WAVE HAND THREE TIMES RIGHT
FINGERS
!77
Lesson 7
Endless Loops
The Foos Chapter 4
Debrief:
• How could you tell the dance was looping? Which commands stood out most?
• What are some real-life situations where endless loops would be more beneficial
than regular loops? What are situations where regular loops might be better?
- Examples: treadmills, escalators, turn signals, water cycle
Unplugged Activity 2:
1. Have students stand in a circle and tell them you have a ball of energy (it’s
imaginary), and the only way to move the ball around the circle is with the sound
“whoosh”.
2. To start the game, send the whoosh ball to the student on your right, exemplifying
how students should say “whoosh” as they send the whoosh ball around. Have
students continue sending the whoosh ball around the circle until it comes back to
you.
3. Introduce two new events. One is “Boink,” which reverses the direction of the ball,
and the other is “Zap,” which sends the ball across the circle. For Boink, tell
students to put their hands up in the “stop” position and say “Boink” to reverse the
direction of the whoosh ball. For Zap, tell students to make eye contact with
someone across the circle and point to that person while saying “Zap” to send the
whoosh ball across the circle. Then play with all three commands.
4. After playing for several minutes, have the whole group discuss and draw out the
code for Whoosh Ball.
!78
Lesson 7
Endless Loops
The Foos Chapter 4
Debrief:
• Have students talk about the code for Whoosh ball. Do they think that loops can be
interrupted by events sometimes?
• Which event interrupts the endless loop in the Astronaut Levels? (hint: Bump
event)
!79
Lesson 8
conditional Statements I
The Foos Chapter 5
Time:
45-60 min
Materials:
Tablets or computers with “The Foos"
Dice
Dice Game Instructions
Bingo Cards
Pencils
Learning Goals:
Understand that a programmer can cause actions to only occur under certain
conditions.
• “IF” blocks describe actions that occur only IF a certain condition is met. For
example, IF it is raining, you use an umbrella.
Demonstrate how IF statements can be used to make programs more dynamic and
efficient.
!80
Lesson 8
conditional Statements I
The Foos Chapter 5
Vocabulary:
Conditional statements/actions: statements/actions that only occur under certain
conditions.
“IF” block: statements/actions that occur only IF the specified condition is met.
Introduction:
Introduce the concept of conditional statements and the IF block by letting the class
know that if they are completely quiet for 10 seconds, you will do something like:
- Put on music and have a dance break
- Play a fun game
- Do 10 jumping jacks
Start counting right away. If the students succeed, give them the reward. Otherwise, let
them know why they did not get the reward.
Then ask the class, “What was the condition of the reward?”
- The condition was if they were quiet for 10 seconds.
- If they were, the condition would be true and they get the reward.
- If they were not, the condition would be false so they do not get the reward.
Ask the students if they can think of other conditional statements from their everyday
life.
Here are some examples:
- If it is cold, you wear a coat.
- If you are tired, you go to sleep.
Introduce the special IF condition of broadcast messaging and selective response.
Let the students know they will have to listen carefully to your instructions in order to
!81
Lesson 8
conditional Statements I
The Foos Chapter 5
go back to their desks/tables to start playing “The Foos.” Then use broadcasting
messaging IF statements to call students back to their tables. Keep broadcasting IF
statements until all students have been selected to return to their desks to start the
game activities.
Game Activities:
Have students play Chapter 5, Levels 35-44, with the Chef Foo.
“IF” block
In the previous chapter, the Astronaut had the bump event. In this chapter the chef
has a new event (broadcast message). When does it run code (selective response)?
!82
Lesson 8
conditional Statements I
The Foos Chapter 5
Unplugged Activity 1:
1. Have students team up in groups of (3-4) and pass out dice and Dice Game
instructions to each group (or write out instructions on a white board/
blackboard).
!83
Lesson 8
conditional Statements I
The Foos Chapter 5
The Rules:
Make a Group.
The oldest player must keep score on a blank piece of paper.
The youngest player rolls first.
The player to the right of youngest rolls next.
Continue taking turns rolling and passing the dice to the right.
IF you roll… you steal a point from your neighbor to the right.
!84
Lesson 8
conditional Statements I
The Foos Chapter 5
Debrief Discussion:
Could you write the code for the Dice Game?
Make a list of every day “IF” conditions that you use in the classroom.
- “If” you do your homework, you get a star
- “If” it is Monday, we go to gym class
- “If” it is raining, we have indoor recess.
ProTip: More Dice Games - If students really enjoy the Iffy Dice Game, have them
create their own set of IF statement rules and play the game again. You can also play
this game with a deck of cards by assigning IF statement rules to each color, suit,
and/or number value.
!85
Lesson 8
conditional Statements I
The Foos Chapter 5
Debrief:
What were the IF conditions in Bingo?
!86
Lesson 9
conditional Statements II
The Foos Chapter 5
Time:
45-60 min
Materials:
Tablets or computers with “The Foos"
Dice
Learning Goals:
Understand that the IF statement can be extended to explain what should happen if
the condition is not met using the IF/ELSE command.
ELSE statements describe what action occurs when the IF statement is false. For
example, IF I call your name, you line up at the door. Or ELSE, you sit on the carpet.
Understand that IF statements can be extended to have multiple IF conditions using
the ELSE/IF command.
Practice how IF, IF/ELSE, and ELSE/IF statements can be used to make programs
more dynamic and efficient.
Practice using IF, IF/ELSE, and ELSE/IF statements embedded in loops to make
programs more dynamic and efficient.
Vocabulary:
IF block- statements/actions that occur only IF the specified condition is met.
Else statement - When an IF action isn't met the ELSE action will execute.
!87
Lesson 9
conditional Statements II
The Foos Chapter 5
Introduction:
Review the concept of IF conditional statements from the previous lesson by
providing a couple of examples:
- If it is sunny, you wear sunglasses.
- If it is Monday, you go to art class.
What happens if the “If” condition is false? If it is NOT Monday, then what?
Explain that sometimes we want an extra condition in case the “IF” statement is not
true. We use the “ELSE” statement instead.
Using a die, show an example of an IF/ELSE statement by telling the class, “IF I roll a
three, then everybody claps. Or else, everybody snaps their fingers.” Roll the dice and
show it to the class to see if they react properly.
Explain to the class that there could also be more than one condition.
For example, “What if I wanted you to clap IF I roll a 3, or ELSE IF I roll something less
than a 3, everyone says “Yay!” or ELSE you snap your fingers. So now we have the
commands IF, ELSE IF, and ELSE.”
!88
Lesson 9
conditional Statements II
The Foos Chapter 5
yes clap
yes say “Yay!”
IF (roll 3)
no ELSE IF
(roll <3) no ELSE snap fingers
(roll not 3 or <3)
2. Tell the class that you are going to call out different conditional statements and IF
they meet the condition, then they get to take a step forward. The student who
makes it to the other side of the room first wins.
3. Call out different conditional statements for the students to respond to. You can
start off with basic IF conditions and progress to IF/ELSE conditions.
Here are some examples of conditional statements to call out during the game:
- IF you are wearing purple, take one step forward.
- IF you are NOT wearing sneakers, take a step forward.
- IF you have a sister, take one step backward. ELSE take one step forward.
- IF you play soccer, take one step forward. ELSE IF you play basketball, take one
step backwards. ELSE don’t move.
!89
Lesson 9
conditional Statements II
The Foos Chapter 5
- IF you have a sister, take one step backward. ELSE take one step forward.
Can you think of other games that have IF and IF/ELSE conditions?
Pro Tip: Lining up with IF Statements - The next time your class is lining up to leave
the room, use conditional IF statements to call students to line up. Keep using IF
statements until all students are lined up.
!90
Lesson 10
Debugging
Foo Studio
Materials:
Tablets or computers with “The Foos”
Pencils
Debugging A and B Handouts
Learning Goals:
Practice creative problem solving skills, including novel ways to solve a problem and
fix algorithms that may be unclear or missing steps.
Recognize that mistakes happen all the time in coding and practice trial and error as
a technique to find solutions.
Vocabulary:
Bugs: Mistakes or problems in algorithms that cause the computer program to do
something we don’t want it to do.
Introduction:
Introduce the concept of debugging and how sometimes things go wrong with
computers and we need to fix them by adjusting the instructions we give them.
Introduce the concept of persistence. Discuss how many times we initially make
some mistakes when trying something new but mistakes offer opportunities to learn.
Examples include: learning to walk, ride a bike, read, and tie shoes.
!91
Lesson 10
Debugging
The same applies for computer science. Coding can be really challenging and even
some of the best coders make mistakes, but they persist until they find the best
solution.
Game Activities:
Foo Studio is a new addition to The Foos where players can build their own video
game levels, share those levels with friends and play levels their peers make. Players
can apply the coding principles they learned in the puzzle levels to reprogram any
object in Foo Studio.
Players earn coins in the puzzle levels that can be used to purchase Foo Store items.
All purchased items can be used in Foo Studio levels.
!92
Lesson 10
Debugging
Player’s published
levels (visible to all)
play level
Delete Resize
Copy Rotate
This is the Published Levels section. All levels the players publish can be seen by
everyone, and players can play levels published by other players:
Featured Levels
Trending Levels
Highest
Rated Levels
!94
Lesson 10
Debugging
Foo Studio
Did students make any mistakes in their code that they had to revise?
How did they figure out what was wrong and how to fix it?
Unplugged Activity 1:
1. Divide students into pairs.
2. Give each pair the name of a simple object. Tell pairs not to share their object
with other pairs.
4. Have each pair write the algorithm to draw their object, but have students include
3 “bugs,” or mistakes in their algorithms.
5. Once all pairs have finished their algorithms, have them switch with another pair
and try to draw the object according to the algorithm. Remind students that they
will need to find the bugs and fix the code to draw the object correctly.
What did they have to add or take out to make the algorithms clearer?
Were there any unintentional bugs that needed to be fixed to make the algorithm
result in the correct drawing? If time allows, have pairs revise and retest their new
algorithms.
!95
Lesson 10
Debugging
- Asking students thoughtful questions that help them problem solve on their own.
- Pointing out actions that helped students accomplish their goals so they
recognize how persistence is connected with their goals.
- Modeling persistence in your teaching.
Unplugged Activity 2:
1. Divide students into pairs.
2. Give each pair a “How to” activity for which they will have to write the algorithm.
Tell students not to share their activities with other pairs. Here are some
examples:
- How to bake a cake
- How to build a paper airplane
- How to get to the playground
- How to write their name
- How to make a sandwich
- How to tie your shoes
3. Have each pair write out the list of steps, or algorithm, to complete their “How to”
activity.
4. Once all pairs are finished, gather the class back together and have each pair share
the steps of their “How to” activity WITHOUT letting the rest of the class know what
the activity is they are trying to teach.
5. Have the rest of the class try to guess what the activity is. If the class has trouble,
ask the pair what they might need to do to revise, or debug, their algorithm to make
the activity clearer.
!96
Lesson 10
Debugging
Are there different ways you could write out the steps to the same activity? Does the
order matter or could things be switched around (e.g., if the activity was baking a cake,
does it matter if you put the eggs in first or the butter?)
!97
WorkSheets by Section
!98
Sequencing
!99
Story Sequence 1
2 1
!100
1
!101
3 Number the boxes in the correct order.
!102
Story Sequence 2
How to Solve:
2 1 x
Number the boxes Write an X in the
in the order that the box if it doesn’t
story goes. belong.
!103
1 Number the boxes in the correct order and write an X in the box
if it doesn’t belong.
!104
2 Number the boxes in the correct order and write an X in the box
if it doesn’t belong.
!105
3 Number the boxes in the correct order and write an X in the box
if it doesn’t belong.
!106
Flexible Sequences
!107
Flexible Sequence 1
How to Solve:
Number the boxes in the order Chef should combine these
ingredients. There are mutiple correct answers!
1 4 3 2
!108
1 Number the boxes in the order Chef should combine these ingredients.
1 3
Number the boxes in the order Chef should combine these ingredients.
2 There are many correct answers!
Bread Bread
!109
3 Number the boxes in the order Chef should combine these ingredients.
There are many correct answers!
Bread Mayo
Ham Bread
Cheese
!110
4 Number the boxes in the order Chef should combine these ingredients.
There are many correct answers!
Bread Mayo
Ham Bread
Cheese Turkey
!111
Flexible Sequence 2
How to Solve:
Number the boxes in the correct order.
(there are mutiple correct answers)
1 4
Some Events must come first Some Events must come last
!112
1 Put the pictures in the correct order.
(there are mutiple correct answers)
!113
2 Put the pictures in the correct order.
(there are mutiple correct answers)
STOP
!114
Put the pictures in the correct order.
3 (there are mutiple correct answers)
!115
Put the pictures in the correct order.
4 (there are mutiple correct answers)
STOP
!116
Commands & Parameters
!117
WALK JUMP RIGHT LEFT
CHANGE
BLOW UP RED BLUE
COLOR
STRAIGHT
CHASE THROW APPLE
UP
CHANGE
BLOW UP RED BLUE
COLOR
!118
Events
!119
The secret map
How to decode:
Hand Clap Event… Go Right one space on the chart.
Turn Lights On And Off Event… Go Down one space on the chart.
!120
1
!121
2
!122
3
!123
Loops
!124
Looping Activity 1
How to Solve:
Give Police Foo the right loop command to reach the
Donut square.
!125
1
Help Police Foo reach the Donut Square!
!126
3
Help Police Foo reach the Donut Square!
!127
Looping Activity 2
How to Solve:
Give Astronaut Foo the right loop commands to reach the puppy square.
Remember the second loop will only run after the first loop has finished.
3 2
!128
Help Astronaut Foo reach the Puppy Square!
1
2
Help Astronaut Foo reach the Puppy Square!
!129
3 Help Astronaut Foo reach the Puppy Square!
!130
Help Astronaut Foo reach the Puppy Square!
4
!131
Help Astronaut Foo reach the Puppy Square!
5
3 2
!132
Efficiency
!133
Foo Quilt making
How to Solve:
!134
Color in the Quilt
1 Use the fewest color crayons possible.
One patch can not be the same color as one next to it.
!135
Color in the Quilt
2 Use the fewest color crayons possible.
One patch can not be the same color as one next to it.
!136
Color in the Quilt
3 Use the fewest color crayons possible.
One patch can not be the same color as one next to it.
!137
Color in the Quilt
4 Use the fewest color crayons possible.
One patch can not be the same color as one next to it.
!138
Color in the Quilt
5 Use the fewest color crayons possible.
One patch can not be the same color as one next to it.
!139
Endless Loops
!140
TURN
CLAP ONCE TWICE
AROUND
SNAP
WAVE HAND THREE TIMES RIGHT
FINGERS
!141
Conditional Statements I
!142
!143
GLOSSARY
Algorithm: Instructions to solve a problem or complete a task. (p. 11)
Command: Primary instructions that tells the computer what action to perform (e.g., run,
jump, walk). (p. 36)
Computer Science: Solving problems with very specific sets of instructions because
computers only do exactly what they are told to do. (p. 5)
Debugging: Finding and fixing problems in algorithms or computer programs. (p. 91)
Efficient programs: Programs that respond more quickly and take less memory and power.
(p. 63)
ELSE statement: When an IF statement isn't met the ELSE actions will execute. (p. 87)
Endless Loop: A set of instructions that is repeated over and over again without end. (p. 73)
Event: An action or cue that signals a new line of code to run. (p. 40, 73)
IF block: Statements/actions that occur only IF the specified condition is met. (p. 81, 87)
Loop: A set of instructions that is repeated over and over again. (p. 51)
Parameter: Details of instructions that adds more specific information about the command
(e.g., direction, color, object to perform an action on). (p. 36)
Persistence: Continuing to try to do something even when it’s hard. (p. 91)
Sequence: The step-by-step order in which instructions should occur. (p. 11, 23)
!144
Rubric for Student Evaluation
Unsatisfactory Competent Proficient Excellent
!145
REFERENCES
Common Core Standards: http://www.corestandards.org/Math/Practice/
!146
Acknowledgments
We would like to thank our advisors Dan Leyzberg (Professor of Computer Science,
Princeton University), Colleen Davis (Professor of Computer Science, Harvey Mudd
University), and Kent Steen (Teacher and Curriculum Specialist for Computer
Science).
We would also like to thank Courtney Blackwell, Bethany Martin, Evan Rushton, and
all the educators who reviewed and gave feedback on the curriculum. Special thanks
to Michael Harvey’s 3rd grade class, who found great alternative solutions for our quilt
making exercise!
Lastly, we would like to thank everyone who has supported and played The Foos!
!147