Reusable reward calculator
Create a calculation that works for different round inputs. Preview: zero completed objectives earns zero; positive counts scale with the per-objective amount.
Runs here · LuauLoading project… · Milestone 1 of 2
Combine two inputs
Implement withBonus(base, bonus) to return base + bonus. Keep return withBonus.
Acceptance criteria
- Implement withBonus(base, bonus) to return base + bonus. Keep return withBonus.
- Handle the visible inputs and additional boundary cases.
Project milestones
- Available to preview
- Available to preview
Prerequisites
Optional extension
Add a documented maximum reward only after choosing and testing its exact boundary.
Project notes and references
Educational example. Review and redesign it for the requirements of a real project.
Your learning source is private by default. Completing this project does not grant a professional or staff role.
Run experiment shows actual behavior. Check milestone uses the acceptance criteria and records trusted progress.
Output
Your output will appear here.
Visible examples
Ordinary · { 4, 2 } → 6
Zero bonus · { 5, 0 } → 5
Sharing is an explicit choice in your portfolio editor. Label exported work “Learning project”; existing publication rules apply.