🧠Concept

Pick the right answer.

Concept · Q1
Space Patrol saves every finished game to the high-scores list. The average of that list is far below the designer's target. What does this tell the designer?
Concept · Q2
One score in high-scores was typed as 3120 instead of 312. Before trusting the average, what should you do?
Concept · Q3
Why show the average variable on the stage with show variable?
Concept · Q4
The tuning rule lowers speed-max only when the average is below the target AND the list holds more than three scores. Why does it also count the scores?
Concept · Q5
In Chapter 14 the enemy speed was typed straight into the enemy script. In this chapter it is stored in speed-max. Why is that better?

👀Code Reading

Look at the blocks. Predict what happens.

Code Reading · CR1
The list high-scores holds [300, 200, 260, 140]. What does the average variable show after this runs?
set [total v] to (0)
set [index v] to (1)
repeat (length of [high-scores v])
  change [total v] by (item (index) of [high-scores v])
  change [index v] by (1)
end
set [average v] to ([floor v] of ((total) / (length of [high-scores v])))
show variable [average v]
Code Reading · CR2
average is 210, target is 250, speed-max is 5, wave-growth is 2, and high-scores holds 5 scores. What are the two settings after this runs?
if <<(average) < (target)> and <(length of [high-scores v]) > (3)>> then
  if <(speed-max) > (3)> then
    set [speed-max v] to ((speed-max) - (1))
  end
  if <(wave-growth) > (1)> then
    set [wave-growth v] to ((wave-growth) - (1))
  end
end
Code Reading · CR3
Item 4 of high-scores was recorded wrong. What does this block do?
replace item (4) of [high-scores v] with (312)
Code Reading · CR4
average is 260, target is 250, and high-scores holds 5 scores. What happens when this runs?
if <<(average) < (target)> and <(length of [high-scores v]) > (3)>> then
  set [speed-max v] to ((speed-max) - (1))
end
Code Reading · CR5
After the settings are tuned, this script runs on every game over. What does it collect?
when I receive [game-over v]
add (score) to [round-2 v]
change [plays v] by (1)

🐛Find the Bug

Something is broken. Pick the fix.

The average of high-scores is right for five scores, but after one more game of Space Patrol is played the average is wrong. The averaging block is shown below. What is the bug?

set [total v] to (0)
set [index v] to (1)
repeat (length of [high-scores v])
  change [total v] by (item (index) of [high-scores v])
  change [index v] by (1)
end
set [average v] to ([floor v] of ((total) / (5)))
show variable [average v]

🛠️Build It

Pick a level. Build it. Check the boxes.

🧑‍🏫
For the teacher

Review the student's project, then check each thing they did.

Project Evaluation

0 of 5 ticked

💬Talk About It

Present your project to your teacher or a classmate.

  1. 1️⃣Show a friend your Space Patrol tuning script running.
  2. 2️⃣Point to your show variable [average] block and your replace item block.
  3. 3️⃣Say one thing each block does for the game.
🧑‍🏫
For the teacher

Watch the student present, then check each thing they did.

Presentation Checklist

0 of 4 ticked

📤Submit

Send your results to your teacher and parent.

0 of 0 answered