Tutorpip← About this lessonOpen the sheet →Download PDF
Ages 8+ · Coding · Step by step
Programs in blocks
1hat block2repeat 4 times3 move forward4turn
Teo's first stack: the C-block repeats only what is inside it.
The big ideaBlock coding snaps pieces together. A hat block starts it, and blocks inside a C repeat.

How it works

Block coding snaps pieces together. Each block is a puzzle piece with a job, such as move, turn or repeat.

A block snaps in only where its shape fits, so there are no typos.

Every stack starts with a hat block, and blocks run from top to bottom, in order.

A C-shaped block hugs other blocks, and whatever sits inside the C gets repeated.

Inside the C• runs every time round• move forward• turn (after the fix)Outside the C• runs just once• before it: once, first• after it: once, last
Inside the C, or outside it.

Example 1: Where the turn sits

  1. Teo's stack has the hat, a C-block that says repeat 4 times, and move forward inside it.
  2. The turn block sits under the C, outside it.
  3. Bo goes forward 4 times in one long line, then turns just once.
1hat block2repeat 4 times3 move forward4turn
Line 4 is outside the C, so it runs once.

Example 2: The fix

  1. Mina drags the turn block up into the C, under move forward.
  2. Now the C holds two blocks, and it goes round 4 times.
  3. Move and turn, move and turn: Bo draws a square with four equal sides.

Example 3: Counting what runs

  1. A stack has say hello, then a C that repeats 3 times with move forward, turn and wave inside, then take a bow.
  2. Say hello runs once. The C runs 3 blocks, 3 times, which is 3 x 3 = 9.
  3. Take a bow runs once, so Bo does 1 + 9 + 1 = 11 actions. The hat block only starts it.
1hat block2say hello3repeat 3 times4 move forward5 turn6 wave7take a bow
Blocks inside the C run 3 times.

Example 4: One bow, at the end

  1. Teo wants one bow, but the bow block is inside the C, so Bo would bow every time round.
  2. The mix-up to fix: drag the bow block out and put it under the C.
  3. Now it runs once, after the loop.

Words to know

hat block
The block that starts the stack.
C-shaped block
A block that repeats the blocks inside it.
stack
Blocks snapped together in a column.
snap
To join a block where its shape fits.

Watch out

Try it

  1. Which block starts every stack?
  2. A C-block says repeat 5 times and holds move forward. How many times does Bo move forward?
  3. A turn block sits under the C, outside it. How many times does it run?
  4. Do blocks run from top to bottom or bottom to top?
  5. A C repeats 2 times and holds move forward and turn. How many blocks run inside the C in all?
Answers: 1. The hat block · 2. 5 · 3. Once · 4. Top to bottom · 5. 4
Try at homeWrite each action on its own sticky note, like step forward, turn round or clap, and stick them in a column, top to bottom. Draw a big C around the ones that should repeat and write how many times. Ask a grown-up to be the robot and follow your blocks exactly, then spot any bugs together.
For grown-upsDo the Mission: write each action on its own sticky note, stick them in a column, and draw a big C around the ones that repeat. Be the robot and follow the notes exactly, then spot any bugs together.
Open these notes on screenScan the code, or go to tutorpip.com.