GoalPlan and read a program in which one character starts when another touches it.
New words
bump · when one character touches anotherstart block · the first block of a program; it says when the program runsreact · to do something because something else happened
Explanation
A program can wait for something to happen. The start on bump block waits until another character touches this one. Then its blocks run. In the picture, the cat walks right 4. If it touches the bird, the bird’s program starts. The bird says Hi! and hops. If the cat does not touch the bird, the bird does nothing.
Worked examples
Step
Instruction
1
Start on bump
2
Say “Hi!”
3
Hop 2
4
End
The algorithm for the bird, step by step. The bird’s program is the one that starts on bump.
The cat walks along the row and touches the bird. The bump makes the bird’s program start.
This time the bird is farther away. The cat stops before it gets there. They do not touch, so the bird’s program does not run.
Class activity
Bump play: you need three children and a line of five floor tiles or paper squares. The “cat” starts at one end and takes 4 steps along the line. The “bird” stands on the last square and waits. When the cat touches the bird’s hand, the bird says “Hi!” and hops twice. Now the bird stands on a different square, too far for the cat to reach. Does the bird do anything? Then add a third child, a “fish”, who starts when the bird touches it.
Practice
1
Which of these is the start on bump block: A, B or C?
B. Its picture shows two circles that bump together.
2
Write the algorithm for the dog.
1 Start on bump. 2 Grow 2. 3 Say “Woof!”. 4 End.
3
The cat walks right 3. The fish has a start on bump program and sits 5 squares away in the same row. Does the fish’s program run?
No. The cat stops 2 squares short, so it does not touch the fish.
4
Why do we plan an algorithm before we make a program?
So we know the steps and their order first. Then it is easier to choose the blocks and to find mistakes.