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

Variables in games

Week 10 · Unit 4: Variables in programming · 3 lessons
Answers are for parents and teachers.
1
Trace the secret word program for the tries sun, star and moon. What does the sprite say each time, and what is attempts at the end?
2
Write the blocks for: if the score is more than 20, the sprite says Great!.
3
A program sets n to 20 and then repeats until n = 0: it says n and changes n by −5. After the loop it says Go!. Write down everything that it says.
4
Design a game on paper in which a boat collects fish. Name three variables, give each a data type and say how the game ends.
5
(if you have a computer or tablet) Build the countdown program in Scratch. Change the starting number and the step and check what the sprite says.