A robot does not understand "go to the kitchen." It understands small steps, done in order, exactly.
π Key idea
A program is a list of steps that a computer follows in order. A loop repeats some steps. In block coding, each step is a block you snap together, like a puzzle.
Step through the program and watch the robot follow each block. Then try the other programs.
π‘ Why it works
Grown-up programmers do the same thing in typed code. Breaking a big job into small, exact steps is the most important skill in programming.
Let's think it through
βοΈ Worked example: Follow the steps
A robot faces right. Its program: forward, forward, turn left, forward. How many squares has it moved, and which way does it face at the end?
Forward, forward: 2 squares right.
Turn left: it now faces up. Turning does not move it.
Forward: 1 square up.
Answer: 3 squares moved; it faces up.
βοΈ Worked example: Use a loop
Write a shorter program for: forward, turn right, forward, turn right, forward, turn right, forward, turn right.
Find the part that repeats: forward, turn right.
It repeats 4 times.
Answer: Repeat 4 times: [forward, turn right]. The robot drives in a square.
β οΈ Common mistake
Counting a turn as a move. A turn changes which way the robot faces, but it stays on the same square.
Try it at home: program a grown-up
Write a program on paper to make a peanut butter sandwich, then have a grown-up follow it exactly, doing only what the words say. "Put peanut butter on bread" might end with the whole jar on the loaf. Fix your program and try again. Free block-coding sites such as Scratch let you program on-screen sprites the same way.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 1 XP.