Debug and build games
Answers are for parents and teachers.
1
Make your own test table for this algorithm: “When the space key is pressed, move 30 steps and say Hi for 1 second.” Write three tests, with the expected result for each.
For example: press space once (x is 30 and Hi is said for 1 second); press space twice (x is 60); do nothing (nothing moves).
2
A windmill sprite starts facing 90. It turns 90 degrees clockwise 7 times. Which way does it face at the end?
90 + 7 × 90 = 720, and 720 − 360 − 360 = 0. It faces 0 (up).
3
Draw the stamps that this script makes on a grid: start at x: 0, y: 0; repeat (3): stamp; change y by 30. Where does the sprite end?
Stamps at y = 0, 30 and 60. The sprite ends at y = 90.
4
With a family member, make a one-week play-time plan for games. Show breaks, time outside and bed time.
The plan should have regular breaks, some outdoor time every day, and a stop time that leaves enough sleep.
5
(if you have a computer or tablet) With a grown-up, add the Pen extension in Scratch and use stamp inside a repeat block. Does it make a row of pictures?
Yes: each time round the loop, the sprite leaves a copy of itself and moves on.