Skip to content
Exit presentation

Programming with Blocks III: Bridge to Text

A named group that takes a number

Chalk rows can be different lengths. Do you need a new block for each row?

In the steps below, n stands for the number of dots.

One definition: draw a row of n dots.
Step 1 of 4
  1. One definition: draw a row of n dots.
  2. Call it with 5: five dots.
  3. Call it with 6: six dots.
  4. Call it with 4: four dots.

No. One named block can draw rows of different lengths.

The rule

A named block can take a number. The same lines run each time, on the number you hand in.

A parameter is a box on the block. The number you hand in goes into the box. To hand in a number means to give it to the block.

One block, called three times
CallNumber handed inDots drawn
155
266
344

Three calls draw 5 + 6 + 4 = 15 dots in all. There is still only one definition.

Hand in a number. Call the block.

Loading lab…

Jump to lesson

This track

  1. 0 Start here
  2. 1 Blocks written as words
  3. 2 One name for a group
  4. 3 A named group that takes a number
  5. 4 Working out what written steps do
  6. 5 Text must be exact
  7. 6 The big picture
  8. 7 Track quiz

Other tracks