AI Course > Grades 8–9 > Lesson 4
GRADES 8–9 · LESSON 4

Test Day: One Friend Plays, I Log 3 Bugs

Hand your game to one friend on your own device, stay quiet, and watch where they get stuck.

By the end of this lesson you will have — one play test on your own device, a log of 3 bugs, and 1 bug fixed and tested again

What you'll show at the end: A bug log with 3 lines (what happened, what should have happened, how to make it happen again) and one bug marked fixed, with the code line you changed.

p5.js Web Editor

Check each tool's age rule before you sign up. If you are under 13, ask a parent first — some tools here are 13+ only.

Follow these steps

  1. Open your game from Lesson 1, 2, or 3 in the p5.js Web Editor. No game yet? Delete the example code in the editor first, then paste the starter code from this page; it has some bugs on purpose.
  2. Before the test, write 3 lines that say what 'fixed' means for your game (for example: "the player never leaves the screen"). Then write where you think your tester will get stuck first.
  3. Hand your device to one friend or family member and say only: "Play it." Don't help. Write down every moment they stop, look confused, or see something strange. No link is needed; they play on your device.
  4. Turn what you saw into 3 bug lines, fix one, and make the same steps happen again to check it. Stuck on a fix? Copy the question from the box next to these steps into the AI you're allowed to use (under 13: a parent's account, with your parent).
Starting fresh?
No game from Lessons 1 to 3? Test this one instead. It has some bugs on purpose.

let px = 50, py = 50, cx = 350, cy = 350;
let caught = false;
let score = 0;

function setup() {
  createCanvas(400, 400);
  textSize(20);
}

function draw() {
  background(220);
  px = constrain(px, 0, width - 30);
  if (keyIsDown(LEFT_ARROW)) px -= 3;
  if (keyIsDown(RIGHT_ARROW)) px += 3;
  if (keyIsDown(UP_ARROW)) py -= 3;
  if (keyIsDown(DOWN_ARROW)) py += 3;
  cx += (px > cx) ? 2 : -2;
  cy += (py > cy) ? 2 : -2;
  if (dist(px, py, cx, cy) < 5) caught = true;
  score += 1;
  fill(0, 120, 255);
  square(px, py, 30);
  fill(255, 60, 60);
  square(cx, cy, 30);
  fill(0);
  text(caught ? "CAUGHT! Score: " + score : "Score: " + score, 10, 25);
}
Source (adapted for this grade: wording changed, facts unchanged)
anthropic.com/learn — AI Fluency: Framework and Foundations, Description and Discernment (adapted for Grades 8–9)

Say it, predict it, check it