Back to Debugging Game Rules Challenge
Code Studio · Level 11

Debugging Game Rules

Become a bug hunter. Fire test cases at your rules and track down the one that lies. Debugging isn't a chore — it's a detective superpower.

15-20 min Ages 9-12 Real Code JavaScript
Code Editor

Test a rule.

Example code
function canWin(items, score) {
  return items.includes("star") && score >= 10;
}

say("Test 1: " + canWin(["star"], 10));
say("Test 2: " + canWin(["key"], 10));
say("Test 3: " + canWin(["star"], 5));
Output

Program result

Robot ready to speak your strings

Type real JavaScript, then run it.