2
Parts that talk
Computing 2: Unit 10, pp. 134–148
GoalPlan and test two characters that send and receive a message.
New words
message · a signal that one character sends to start anothersend · to give out a messagereceive · to get a message and then start
Explanation
In a story, one character can finish and then the next character starts. The first character sends a message. The second character starts when it receives the message. A message has a colour, such as orange or blue. The colours must match, or the second character will never start. Test each character on its own first. Then test them together.
Worked examples
| Step | Parrot | Cat |
|---|---|---|
| 1 | Start on green flag | Start on blue message |
| 2 | Say “Hello!” | Say “Meow” |
| 3 | Send blue message | Move right 2 |
| 4 | Stop | Stop |
To test the cat on its own, tap its blocks. It does not need the parrot. Then tap the green flag to test both together.
The parrot sends a blue message, but the cat waits for an orange message. The parrot talks. The cat does nothing. The colours do not match, so we change the cat’s first block to blue.
Class activity
Message relay (four players): player 1 starts on a clap, says “Hello!” and passes a blue card to player 2. Player 2 starts only when they get a blue card, claps 3 times and passes an orange card to player 3. Player 3 starts on orange and says “Bye!”. Then try again, but player 1 passes the wrong colour on purpose. What happens?
Practice
1
A second character must start when the first one sends a green message. Which block does it need?
A “start on green message” block.
2
The duck sends a red message. The dog starts on a blue message. What happens, and how do you fix it?
The dog never starts. Change the dog’s first block to “start on red message”.
3
How can you test the second character on its own?
Tap its own blocks to run them. You do not need the first character.
4
Write the algorithm for a fox that starts on an orange message, moves left 2, says “Hi!” and stops.
1 Start on orange message. 2 Move left 2. 3 Say “Hi!”. 4 Stop.