AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Code it as a team

Week 19 · Unit 8: Be a musician · 3 lessons
2

Which group is it in?

Computing 3: Unit 8, pp. 119–134
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.

Inputon buttonApressedBasicshow stringHi!clear screenMusicset volume50stop all sounds
Worked examples
BlockGroup
on button pressedInput
on shakeInput
show iconBasic
clear screenBasic
pauseBasic
set volumeMusic
play sound until doneMusic
start melodyMusic
Each block has a home group.
Input blockonshakeOutput blockshow iconghost
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 mixed programonshakeshow iconsnakeplay soundslideuntil done
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
2
Which of these is an input block?
Ashow iconduckBonshakeCplay soundyawnuntil done
3
The program should play the yawn sound after the icon. Which block goes in the gap, and which group is it in?
on buttonApressedshow iconduck?clear screen
4
Why do the groups of blocks have different colours?