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, or outside it.
Example 1: Where the turn sits
Teo's stack has the hat, a C-block that says repeat 4 times, and move forward inside it.
The turn block sits under the C, outside it.
Bo goes forward 4 times in one long line, then turns just once.
Line 4 is outside the C, so it runs once.
Example 2: The fix
Mina drags the turn block up into the C, under move forward.
Now the C holds two blocks, and it goes round 4 times.
Move and turn, move and turn: Bo draws a square with four equal sides.
Example 3: Counting what runs
A stack has say hello, then a C that repeats 3 times with move forward, turn and wave inside, then take a bow.
Say hello runs once. The C runs 3 blocks, 3 times, which is 3 x 3 = 9.
Take a bow runs once, so Bo does 1 + 9 + 1 = 11 actions. The hat block only starts it.
Blocks inside the C run 3 times.
Example 4: One bow, at the end
Teo wants one bow, but the bow block is inside the C, so Bo would bow every time round.
The mix-up to fix: drag the bow block out and put it under the C.
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
A block inside the C repeats. A block outside it runs once.
Blocks snap only where they fit, so a block that will not go in is a clue.
Blocks run from the top to the bottom. The order matters.
No typos does not mean no bugs. A bug can still hide in the order.
Try it
Which block starts every stack?
A C-block says repeat 5 times and holds move forward. How many times does Bo move forward?
A turn block sits under the C, outside it. How many times does it run?
Do blocks run from top to bottom or bottom to top?
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.