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.
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));
Program result
- Run your code to see output.
Type real JavaScript, then run it.
Debug test ran.
You wrote test cases that check the same rule with different inputs.
Open Debug Builder