Brothers LearningFREE LESSONS FOR EVERY CLASSROOM
Brothers Learningany school district
Day 4 · Monday, October 5

Sense · Move · Code

Plan it in plain words. Then build it in blocks.

Last week your robot answered one color at a time. Real jobs take many steps in the right order, and a robot only does exactly what it is told. Today you learn the two habits every programmer uses before touching a block: breaking a big job into small pieces, and writing the plan in plain sentences first.

Group sizeFour, one computer
Opencode.legoeducation.com
LEGO lessonBasics 03 · Forest Flight Rescue
1. drive to the tree2. stop3. lower the hook4. wait 1 second5. raise the hook6. drive backPLAN FIRSTwhen program startsrun motors forwardstop motorsturn arm downwait 1 secondturn arm uprun motors backone sentence = one block

Absent today? Read this page, then do sections 03 and 04 on paper: break the pancake job into steps, and write the pseudocode for the delivery robot. Bring both to me before class tomorrow, because tomorrow is the programming test. You will get five minutes with a kit afterward to run one of your plans.

0–5 minWarm-up: say the steps
5–12Break a job into pieces
12–18Plain words first: pseudocode
18–36Forest Flight Rescue
36–44Your course challenge
44–48Test review
48–50Sort and charge
01

Warm-up · Say the steps

Tell a robot how to get out of this room.

Pick a partner. One of you is the robot, standing at your desk. The other gives directions out loud. The robot does exactly what it hears and nothing more. “Go to the door” does not count, because the robot does not know what “go” means or which way the door is.

What you just found out

You already know how to leave a room, so you skip steps without noticing. A robot cannot fill in what you skipped. Turn left, how far? Walk, how many steps? Stop, when?

The rule for today

Every step has to be small enough to do with no guessing, and the steps have to be in the right order. You already know the word for the order: a sequence, from Day 1.

Warm-up0:00

02

New idea · Decomposition

Breaking one big job into small jobs is called decomposition.

“Make breakfast” is too big to program. “Crack an egg into the bowl” is small enough. Decomposition means you keep splitting a job into smaller parts until every part is something you know exactly how to do. The word comes from the Latin de-, “apart,” and componere, “to put together”: taking something apart to see what it is made of.

The big job

Deliver a plate from the kitchen to Table 2.

Smaller jobs

Pick up the plate. Drive to the table. Set it down. Come back.

Small enough to code

Drive forward 2 seconds. Stop. Turn the arm motor down a quarter turn. Wait 1 second. Turn it back up.

Check yourself

Is “drive to the table” small enough to code? Not yet. Which way? How far? A step is small enough when it turns into one or two blocks with numbers in them.

03

New idea · Pseudocode

Pseudocode is your program written as plain sentences.

You met pseudocode on Friday when you planned your lab. Here is the full idea. Pseudo is Greek for “false,” so pseudocode is “not-quite code.” It is written for people, not for the computer. Your whole team reads it, agrees on it, and catches mistakes in it before anyone drags a block. Each line of pseudocode should become one block, or a very small stack of blocks.

Good pseudocode

when program starts run both motors forward at 50% wait 2 seconds stop both motors when color is red turn arm motor down 90°

Every line is one action, with a number where a number is needed.

Not pseudocode yet

go get the plate and bring it back quickly

How far? Which motor? How fast is “quickly”? A robot cannot answer these for you.

Try it · The pancake job

In your notebook, decompose “make one pancake” into at least eight small steps in the right order. Then trade notebooks with your partner and be the robot: follow their steps exactly. Mark any step where you had to guess.

See one good answer

1. Turn the burner to medium. 2. Set the pan on the burner. 3. Wait 2 minutes. 4. Pour ¼ cup of batter into the center of the pan. 5. Wait until bubbles cover the top, about 2 minutes. 6. Slide the spatula under the pancake and flip it. 7. Wait 1 minute. 8. Lift it onto the plate. 9. Turn the burner off. Notice step 5: a good plan says what to wait for, not just how long. That is an event, the same idea as Thursday.

04

LEGO lesson 3 · Basics · Forest Flight Rescue

Plan the rescue in plain words. Then code it.

Open the lesson in the Teacher Portal on the board. Build the model your team is given, split the steps by minifigure color the same way as last week, and read the mission out loud as a team.

  1. Decompose the mission. Before the computer opens, the Recorder writes the big job at the top of the page and splits it into smaller jobs underneath.
  2. Write the pseudocode. One line per action, with numbers: how far, how long, which motor. The whole team agrees on it.
  3. Build the blocks to match. The Coder drags one block for each line and reads them back out loud. If a line has no block, the line was not small enough.
  4. Test it. The Tester runs it and calls out the first step that did not do what the pseudocode said.
  5. Fix the plan, then the code. Change the pseudocode first, then the blocks. Change one thing at a time.

Practice without a kit · The delivery robot

A rover waits in the kitchen. When it sees green, it must drive forward for 3 seconds to Table 1, stop, wait 2 seconds while the plate is taken, and drive backward for 3 seconds to the kitchen. When it sees red, it must stop at once. Write the pseudocode.

Check your pseudocode
when color is green run both motors forward wait 3 seconds stop both motors wait 2 seconds run both motors backward wait 3 seconds stop both motors when color is red stop both motors

Two events, each with its own stack. If your forward and backward times do not match, the rover will not end up back in the kitchen.

Find the bug

when program starts run both motors forward stop both motors wait 2 seconds

The team expected the rover to drive for 2 seconds. It barely moved. Why?

Show the bug

The wait is in the wrong place. The motors start and then stop instantly, and the robot waits 2 seconds standing still. Move wait 2 seconds between “run” and “stop.” The blocks were right; the sequence was wrong.

05

Your course challenge

Decompose a lab job, then program it.

Your class:

Physics · Out and back

Program your rover to drive forward 50 cm, stop for 2 seconds, and return to the start line. Decompose it first. Then measure how far from the start line it actually ends up. Last Friday you saw that the robot does not reach full speed instantly. How does that show up here, and what would you change in your plan to land on the line?

06

Test tomorrow

What tomorrow’s test covers.

Programming test · Tuesday, October 6

The test is on paper. No kits, no computers. Bring a pencil. It covers all four days:

  • The kit: every part in the box, which parts are inputs and which are outputs, and what a connection card does.
  • Words: input, output, sequence, event, debugging, pseudocode, decomposition.
  • Events: the “When ___, then ___” sentence, and why event blocks sit at the top of a stack.
  • Reading code: predict what a short program will make the robot do.
  • Fixing code: find the bug in a program and say how to fix it.
  • Writing a plan: decompose a job and write the pseudocode.
  • Your lab: what your team measured on Friday and what you found.
  1. In your own words, what is decomposition?
  2. Why do programmers write pseudocode before they build code?
  3. Turn this into pseudocode: “When the sensor sees blue, spin the fan for 5 seconds, then stop.”
Teacher notes · Day 4

LEGO material: Teacher Portal → CS & AI 6–8 → Basics → 03 Forest Flight Rescue (the pseudocode lesson). Open the lesson PIN and building pages from the Portal; the PIN is not printed here. Block wording on this page is simplified, and the real palette wording differs a little.

Teaching order: the warm-up gives students an experience of being misunderstood before they see the words. Decomposition and pseudocode are each introduced in full before students use them, then checked with the pancake job and the delivery robot.

If time runs short: skip the course challenge and go straight to the test review. The delivery robot and the bug in section 04 match the style of tomorrow’s test questions.

End of class: everything back on the charger. Tomorrow is a paper test; the kits stay in the cabinet.

Standards. Science and engineering practices (strand 1) in P.1, C.1, IPC.1: plan investigations, use appropriate tools, and develop and use models. CSTA grades 6–8: 2-AP-10 use flowcharts and/or pseudocode to address problems as algorithms; 2-AP-13 decompose problems into parts to make them easier to program; 2-AP-17 systematically test and refine programs.

Next class · Tuesday

Programming test.

Paper only. Everything from Days 1 through 4.

The test →