Level 5

Fix the Game with Data

Level 5 · Chapter 15

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Data & Analysis · Grades 6–8

Improve a model using the data it makes.

Code 2-DA-09Read the official text

Also practised: 2-DA-08

Common Core State Standards for Mathematics

Statistics & Probability · Grade 6

Describe a set of data with its middle and spread.

Code 6.SP.B.5Read the official text

The short lines are our own words. We matched this lesson to these standards ourselves; the standards' owners have not reviewed or endorsed this course.

Common Core State Standards © 2010 National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Today you will average the high-scores list from Space Patrol, clean a bad entry, and tune two game settings.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-DA-09 · CSTA 2-DA-08 · ISTE 1.5.b · Standards
🎯 I canaverage the high-scores list from Space Patrol, clean a bad entry, and tune two game settings
📝 New words7 words
⏱ Lesson time~40 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students may divide the total by a hardcoded number (like 5) instead of length of [high-scores ▾]. The average breaks the moment one more game is played. Always divide by the live length of the list.
  • Students may think one bad score does not matter. A single wrong entry (3120 instead of 312) can pull the whole average far off. Data must be cleaned before it is trusted.
  • Students may tune a setting after one game. One score is not data — the rule checks that the list holds more than three scores before it changes anything.

🎯 Differentiation

🐢 Struggling: Average three scores on paper first. Then match each paper step to a block, and change only speed-max — leave wave-growth alone.

🚀 Advanced: Average round 1 and round 2 separately and report which settings made the game fairer.

💡 During the lesson

  • Warm-UpThis chapter is one full turn of the refinement loop (CSTA 2-DA-09) on the Level 5 capstone: collect → inspect → clean → tune → retest → collect again. Draw the loop on the board as a circle, not a line. Space Patrol already writes high-scores on game over, so students arrive with a real dataset — the two settings they tune (speed-max, wave-growth) are the numbers Chapter 14 left typed inside the enemy scripts.
  • Try ItThe first experiment averages the data Space Patrol already collected. The second experiment is the cleaning step (2-DA-08): a bad entry of 3120 becomes 312. The third experiment is the refinement decision (2-DA-09) and it is deliberately compound — the outer test needs BOTH a low average AND more than three scores, and each inner test protects a setting from being driven past its floor. Run them in order and read the average after each. In the third Try round, the ÷ length of high-scores block fails only because just two scores were added to total — over the whole list it is the right method, as Fix It shows.
  • PlanThe outer IF: is the heart of 2-DA-09 — the model changes only when the data says it should, and only when there is enough data to trust. Ask: "Why does the rule count the scores as well as read the average?" (One unlucky game is not evidence.) The two inner diamonds are floors: a setting stops falling once it reaches its smallest safe value. The second lane closes the loop — every new game over feeds fresh scores back in.
  • BuildSteps 8–9 model data cleaning (2-DA-08): one bad entry distorts the average until it is replaced. Steps 10–11 model refinement (2-DA-09): the settings change only when the data crosses the target, and step 11 deliberately flips the outcome so students see both branches. Step 12 is the part designers forget — after a change you must gather fresh data, or you are tuning on numbers from a game that no longer exists. Round-2 scores rising is the evidence that the tuning worked.