AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Loops repeat for us

Week 1 · Unit 1: Be an animator · 3 lessons
1

Spot the pattern

Computing 4: Unit 1, pp. 8–19
GoalFind the part of a pattern that repeats and say what comes next.
New words
pattern · things that come in an order that repeatsrepetition · doing or running the same thing again and againloop · a set of instructions that is run again and again
Explanation

Listen to this rhythm: drum, drum, clap, drum, drum, clap. The same three sounds come round again and again. This is a pattern, and the part that repeats is “drum, drum, clap”. Computers are good at repetition. Instead of giving the same instructions many times, a program can use a loop. A loop is a set of instructions that is run again and again. An animation uses loops too: a few pictures are shown over and over, and the character seems to move. The first job is always to spot the part that repeats.

drumdrumclapdrumdrumclap
Worked examples
starstarheartstarstarheartstarstarheart
A sticker border goes: star, star, heart, star, star, heart, star, star, heart. The part that repeats is “star, star, heart”. It repeats 3 times, so there are 9 stickers in all.
1234
A flip book is a loop of pictures. These four pictures show a ball at the left, the middle, the right and the middle again. Flip them over and over and the ball seems to swing from side to side for ever.
Time roundMoves
1jump, jump, turn
2jump, jump, turn
3jump, jump, turn
4jump, jump, turn
A pattern “jump, jump, turn” is repeated 4 times. Each time round has 3 moves, so there are 3 × 4 = 12 moves in all.
Class activity

Rhythm game (with a friend or family): one person makes up a short pattern of three moves, for example clap, stamp, stamp. The other person repeats it four times without stopping. Count the moves together: how many in all? Now make a pattern of four moves and repeat it three times. Is the total the same? Last, change one move in the middle and see if your partner notices that the pattern has broken. If you have a computer or tablet and an adult, watch a short animation and find the pictures that repeat.

Practice
1
What comes next in this pattern?
drumclapclapdrumclapclapdrum?
2
Say the part that repeats: pat, clap, clap, snap, pat, clap, clap, snap.
3
A cat is at the left in Frame 1, a little to the right in Frame 2 and more to the right in Frame 3. If the cat keeps walking right, where is it in Frame 4?
Frame 1Frame 2Frame 3?Frame 4
4
The pattern “hop, hop, spin” is repeated 5 times. How many moves are there in all?