With Tek

What is a function in coding

A function in coding is a set of steps with a name. You write the steps once, then use the name again and again, anywhere in a program. In this course your kid learns it with paper cards: a happy dance of spin, clap, and jump goes on the back of one block card, the name goes on the front, and a grown-up plays the robot that flips the card and does the steps. Your kid then changes the block once and watches every dance change, and puts one block inside another. Tek hosts four short films for kids 6 to 13, and your kid ends with a card program built from blocks they named. Plan about 4 minutes of films and 30–45 minutes of play. On Kubrio, all four films and the quiz are free, with no account.

All 4 lessons and the quiz are free on this page. Your kid doesn't need an account. See every lesson

Liked this lesson?

There's a whole world of this.

In Kubrio Worlds your kid explores places, asks the people who made them anything, and makes their own things. You set the screen time.

3 days free, then $49 $19 a month per kid.

▶ 1:45 tour

What your kid makes

Your kid ends with a card program built from blocks they named: a dance block with its steps on the back, and a Party block that uses it. A grown-up plays the robot, flips each block, and does the steps.

Ages
6 to 13
Time
4 films, about 4 minutes, then 30–45 minutes of play
You need
Paper or blank cards, and a pencil, one bigger card for each block, tape for a grid on the floor (optional), a grown-up to play the robot
Host
Tek

The 4 lessons

  1. Lesson 1. Give steps a name

    Steps that go together can share one name. One card that says Happy dance does all three steps: spin, clap, jump. Coders call a set of steps with a name a function.

    1. Pick three moves for a dance
    2. Draw each move on a card
    3. Give your dance a name

    Where: Paper

  2. Lesson 2. Front and back

    The name goes on the front of the block card, and the steps go on the back. You write the steps once, then use the name anywhere in your program.

    1. Write the name on the front of a big card
    2. Draw the steps on the back
    3. Use the block twice in a program, and let your robot play it

    Where: At home

  3. Lesson 3. Change it once

    Change the back of the block, and every dance in the program changes. A mistake gets fixed in one place, and it's fixed everywhere.

    1. Add one new move to the back of your block
    2. Play the program again
    3. Watch every dance change

    Where: At home

  4. Lesson 4. Blocks inside blocks

    A block can use another block. A Party block holds two happy dances and a bow. Big programs are small named blocks inside bigger ones.

    1. Make a Party block
    2. Put your dance block inside it
    3. Play a whole show with your robot

    Where: At home

Take the quiz

Tek asks 3 questions about the films. Get 2 right and you finish the course.

Transcript

Lesson 1: Give steps a name

Hi, I'm Tek! Your robot knows a happy dance. Spin, clap, jump!

Now you want the dance after every move. Forward, spin, clap, jump. Forward, spin, clap, jump. Look at all those cards!

Coders have a trick. Put the steps that go together in one pile, and give the pile a name. Happy dance!

Now one card says happy dance. When the robot reads it, it does all three steps.

A set of steps with a name is called a function. It's like making your own block!

Your turn. Pick three moves for a dance. Draw them on cards, and give your dance a name.

Lesson 2: Front and back

Let's make the happy dance block for real. Grab a big card!

On the front, write the name. Happy dance. On the back, draw the steps. Spin, clap, jump.

Now the program. Forward, happy dance, forward, happy dance. Four cards instead of eight!

Your grown-up plays the robot. Forward. Happy dance! Flip the card. Spin, clap, jump. Flip it back, and on to the next card.

You write the steps once. Then you can use the name again and again, anywhere in your program.

Your turn. Make your block, front and back. Use it twice in a program, and let your robot play it.

Lesson 3: Change it once

Your dance is good. Let's make it even better!

Add a wiggle. Where do you write it? Only on the back of the block. Spin, clap, jump, wiggle.

Now play the program again. Forward, happy dance. The robot flips the card and does the new dance. Wiggle!

The second happy dance has the wiggle too. You changed one card, and every dance changed!

That's why coders love functions. Find a mistake? Fix it in one place, and it's fixed everywhere.

Your turn. Add one new move to the back of your block. Play again, and watch every dance change.

Lesson 4: Blocks inside blocks

Here's a big coder move. A block can use another block!

Make a new block called party. On the back: happy dance, happy dance, and a bow.

The robot reads party, and flips it. The first step is happy dance, so it flips that card too. Spin, clap, jump, wiggle!

Then back to party. Happy dance again. Then a bow. Ta-da!

Big programs are built this way. Small blocks go inside bigger blocks, and each one has a name.

Your turn. Make a party block that uses your dance. Play a whole show with your robot. You made your own blocks!

Free guides to practise with

Questions parents ask

What is a function in coding, in kid words?

A function is a set of steps with a name. A coder writes the steps once, gives them a name, and then uses the name every time the program needs those steps. In the course, the name is on the front of a card and the steps are on the back.

Does my kid need a computer for this?

No. The whole course happens with paper cards and a grown-up who plays the robot. Your kid writes the program, and you follow it one card at a time, flipping a block card to read its steps.

What age is this for?

Kids 6 to 13. Younger kids enjoy making a dance and watching a grown-up do it. Older kids see why coders use functions: one change fixes every place the block is used. All four films and the quiz are free on Kubrio, with no account.

See every course

From the makers of these free courses

Curious, not hooked.

Kids explore worlds, ask the people who made them anything, and make their own things. 20 minutes a day by default, and you can change it.

3 days free, then $49 $19 a month per kid.

  • 13worlds open
  • 500+questions answered
  • 20 mina day, set by you