GoalFind blocks in the right group and tell input blocks from output blocks.
New words
group · a set of blocks of the same kind, which share a colour and a nameInput group · the blocks that wait for something, such as a button pressBasic group · blocks for everyday jobs such as showing icons and words, clearing the screen and pausing
Explanation
The blocks in an editor are sorted into groups, and each group has its own colour and name. The Input group has blocks that wait for something to happen, such as “on button pressed” or “on shake”. These blocks start a program. The Basic group has blocks for showing an icon, showing a string, clearing the screen and pausing. The Music group has blocks for sound, such as “set volume”, “play sound until done” and “start melody”. Knowing the group helps you find a block quickly.
Worked examples
Block
Group
on button pressed
Input
on shake
Input
show icon
Basic
clear screen
Basic
pause
Basic
set volume
Music
play sound until done
Music
start melody
Music
Each block has a home group.
Input blocks start things and output blocks do things. “on shake” waits for a shake, so it is an input block. “show icon” shows a picture, so it is an output block.
A program often uses blocks from more than one group. This one has one from Input, one from Basic and one from Music.
Class activity
Block sort (in a group): write twelve blocks on cards, for example “on button A pressed”, “show number 5”, “clear screen”, “pause 2 seconds”, “set volume 100”, “stop all sounds”, “on shake”, “start melody ringtone”, “show string Go”, “play sound happy until done”, “show icon house” and “on button B pressed”. Make three signs: Input, Basic and Music, and colour them in three different colours. Take turns to place a card under the right sign. Then mark each card as “input” or “output”.
Practice
1
Which group do these blocks belong to? show number · stop all sounds · on shake · show string
show number: Basic. stop all sounds: Music. on shake: Input. show string: Basic.
2
Which of these is an input block?
The middle one, “on shake”. It waits for the board to be shaken. The other two make something happen.
3
The program should play the yawn sound after the icon. Which block goes in the gap, and which group is it in?
play sound [yawn v] until done. It is in the Music group.
4
Why do the groups of blocks have different colours?
The colours show which group a block belongs to, so we can find blocks quickly.