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

Clear instructions

Week 6 · 1.3 What happens next? · 3 lessons
3

Change an algorithm

Computing 1: Topic 1.3, pp. 33–48
GoalChange a step in an algorithm and say how the result changes.
New words
change · make something differentresult · what you get at the end
Explanation

We can change an algorithm. Change one step and the result changes. The steps stay in the same order. Only one thing is different. We follow the new algorithm to check the result.

algorithmchange a stepnew result
Worked examples
Old algorithm: 1 blue, 2 yellow, 3 red. New algorithm: change step 2 to green. Now the stripes are blue, green, red.
Change step 1 to red. The new stripes are red, green, red. Only the top stripe changed.
smallbig
We can change a drawing algorithm too: ‘Draw a small circle’ changes to ‘Draw a big circle’.
Class activity

Change it: write a three-stripe algorithm, with colours. Give it to a friend to colour. Then change ONE step and give it to a friend again. Place the two flags side by side. What is different? What is the same?

Practice
1
Algorithm: 1 blue, 2 yellow, 3 red. Change step 3 to green. What colour is the bottom stripe?
2
Which algorithm makes this flag? A: 1 blue 2 yellow 3 red. B: 1 yellow 2 blue 3 red.
3
Algorithm: 1 red, 2 green, 3 blue. Change step 1 to blue. Say all the stripes now.
4
If you change one step, does the result stay exactly the same?