← Back to course
Code Crew G3 / Week 01 / Tuesday
2/6
Week 01 Β· Sequencing

Tuesday

// What comes first?

Tuesday: Pancake Code

"I have an idea!" Rocket says. "Let's make pancakes!" He grabs the pan and the eggs at once. The recipe cards spill across the floor.

Raven picks them up. "What do you notice about these steps?" she asks. "Some must come before others."

Nova floats over the cards. "Look for the step that needs nothing before it," she says.

First, let's fix the pancake recipe. Then we can sort a bedtime routine too.

Rocket wants pancakes. The recipe steps below got mixed up. Put them in the order they should happen, first to last.

PANCAKE RECIPE
  • ?Mix flour, water, and eggs in the bowl
  • ?Flip when bubbles appear
  • ?Eat the pancake
  • ?Pour batter into the pan
  • ?Heat the pan on the stove
  • ?Get out a bowl and a pan
WHY THIS EXERCISEReal code has dependencies. You have to do the early steps before you can do the later ones. Coders call this a dependency: one step depends on another.
β—‡ PARTNER MOVE
Read your order out loud to a partner.
Did anything sound silly? Fix it before you flip the page.

More Sequencing

ROBOT DANCE (4 MOVES)
CREATIVE Β· NOT GRADED

Drag the moves into the order you want for your dance, then save it.

  • ?Spin around
  • ?Clap
  • ?Step left
  • ?Step right
BEDTIME ROUTINE
  • ?Climb into bed
  • ?Put on pajamas
  • ?Read a book
  • ?Turn off the light
  • ?Brush teeth
WHY THIS EXERCISEDaily routines are perfect examples of sequences. Programmers build big programs by chaining simple, predictable sequences like this one.

Steps That Need Other Steps

Some steps need another step done first. You cannot flip a pancake before it is in the pan.

WHAT MUST HAPPEN FIRST?
  • Read the question.
  • Tap your answer.
Before you pour batter, what must you do?
Before you climb into bed, what is a good step?
Before you read a book, what must you do?
Which step needs NOTHING before it?
Raven sorts four steps. Which step can only happen after the pan is hot? Type pour or heat.
WHY THIS EXERCISEProgrammers check which steps depend on other steps before they pick an order.
Try Without Paper
Tell someone the steps to make your favorite sandwich.
Did you skip a step? That's a BUG. (More on bugs in Week 6.)
← Monday