Offline activities · Quest 8
The loop dance
Invent a short dance and use a loop to repeat it, then a while loop to stop it.
10 minutes
You will need
- Space to move
- Music, if you like
- Paper to write the program
What to do
- Choose three moves, such as clap, spin, jump.
- Write them as a block: clap, spin, jump.
- Write “for i in range(3):” above the block and dance it three times.
- Now write “while music is playing:” and dance until the music stops.
- Add a counter: after each round, say the number of rounds out loud.
Talk about it
- When is for better and when is while?
- What would an endless loop look like in a dance?
