🏏 Cricket Scoreboard · Mission 2 of 8
➕ The Total
The big number on the scoreboard is the team's total. The scorer also made a mistake: Fix sets a batter's runs to the right number. Whatever happens, the total must come out right.
Your mission
- Fix: if ball.kind == "fix", set the striker's runs to ball.runs (no ball faced). Otherwise, score as before.
- Then add up the total: total = 0, and For Each b in batters, total = total + b.runs.
- Fix a batter's runs on the right: the total follows.
Getting the mission ready…