Module 7 · In Studio · challenge 3 of 3 in this lesson

speedPrice returns the default for nil, text and NaN, rounds to whole coins and clamps between min and max

A test in Studio grades it and prints a pass code.

Open

Level 3, Professional

Challenge

Write the five rules in challenges/work/experiment_rules.luau. The test is challenges/experiments-and-alerts.luau and the written solution is challenges/solutions/experiments-and-alerts.md. Run it with the command in the footer.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("experiments-and-alerts", "experiments-rules") in the server command bar. Copy the pass code from Output.

Done means

  • speedPrice returns the default for nil, text and NaN, rounds to whole coins and clamps between min and max
  • significant is true only when the interval is entirely above or entirely below 0
  • decide returns restart, wait, keep control, trade-off with the first guardrail in alphabetical order, or ship variant, in that order of checks
  • durationValid and alertFires follow the Alerts rules: 1 to 10 whole checks, at least 5 for minute, strictly above the threshold
  • challenges/experiments-and-alerts.luau prints TEST PASS for every check

The Course Runner prints this code when the test passes.