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

challenges/work/economy_math.luau returns coins per round from pickups, survival and a Config table

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

Open

Level 3, Professional

Challenge

Write the economy arithmetic as pure functions in the learner file. The test file (challenges/monetization-economy.luau) is in the game repo at m14-ship, and the written solution is challenges/solutions/monetization-economy.md.

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

Done means

  • challenges/work/economy_math.luau returns coins per round from pickups, survival and a Config table
  • It returns the number of rounds to afford a price, rounded up, and never loops forever on a zero income
  • It returns the lowest regional price for a default price, never below 1
  • challenges/monetization-economy.luau prints TEST PASS for every check

The Course Runner prints this code when the test passes.