Loops and light shows
Answers are for parents and teachers.
1
Write the blocks, in words, for a program that shows the heart for 1 second and clears the screen, 4 times. How long does it run if the screen stays blank for 1 second after every heart?
repeat (4) times: show icon heart, pause 1000, clear screen, pause 1000. One round is 2 seconds, so the program runs 8 seconds.
2
The arrow spinner shows North, East, South and West for 0.5 seconds each. Which arrow is on at 9.7 seconds?
West. 9.7 s is four cycles (8 s) and 1.7 s, and 1.5 s to 2.0 s is the West arrow.
3
Name one loop that ends by itself and one loop that never ends by itself.
The repeat (n) times loop ends by itself. The forever loop never ends by itself.
4
Plan a light show of your own with at least 4 steps. Use one input, one loop and a final step. Write the steps and work out how long it takes.
Answers differ. The steps are numbered, one input starts the show, and the time is the round time times the repeats plus the rest.
5
Name two inputs and two outputs of a robot you know or can imagine.
For example: inputs camera and microphone; outputs wheels and speaker.