Say It Once, Do It Many Times: Loops in Code
1 of 4ICT · My World Quest — full scheme of work · explorer
Say It Once, Do It Many Times: Loops in Code
For grown-ups
Companion summary
Have you ever noticed how a washing machine spins the same way, over and over, until the cycle is done? Games, apps, and even robots use loops so they never have to write the same instruction hundreds of times. A single loop in Minecraft's code makes trees grow the same way every time you plant one. When you finish, try writing a loop that makes a character dance three times in a row.
The Clapping Game
The Clapping Game
Imagine your teacher says: 'Clap your hands three times.' You clap, clap, clap — done! Now imagine she said 'Clap your hands' fifty times. That is a very long list! Computers face this problem too. Writing the same instruction over and over wastes space and time. Coders found a clever shortcut. Can you guess what it might be?
💭 Think about this
If you had to write instructions for jumping ten times, how would you write it the short way?
