Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1forever if touching edge? then turn 180 degrees | Aforever if touching color red? then say Ouch! | |
| 2repeat until score = 10 if key space pressed? then change score by 1 | Brepeat until lives = 0 if touching enemy? then change lives by -1 | |
| 3An if block inside a loop is checked again on every repeat, so the program can make a new decision each time. | CThe loop keeps checking for the space key and adds 1 to score each time it is pressed, until score reaches 10. | |
| 4A repeat until loop can hold an if block, so the loop checks its own stop condition and also makes decisions inside. | DThe second if block sits below the loop, so the bomb is only checked once after the loop ends, not on every repeat. | |
| 5if touching edge? then forever turn 15 degrees | EThe sprite checks the edge on every repeat, forever, and turns whenever it is touching the edge. | |
| 6repeat until score = 5 if touching star? then change score by 1 if touching bomb? then say Boom! | FThe if block is outside the loop, so touching edge? is checked only once, at the start, and never again. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
if inside a loop — An if block placed inside a loop is checked again on every repeat, so the program makes a new decision each time round, like in forever or repeat until.forever
if <key space pressed?> then
say "Jump!"forever
if <touching edge?> then
turn 15 degreesrepeat until <score = 10>
if <touching coin?> then
change score by 1repeat until <score = 10>
if <touching coin?> then
change score by 1repeat until <lives = 0>
if <touching ghost?> then
change lives by -1