I’d like to submit my solution, is nice to actually do, and I believe that others may have alternative solutions, may have things that I overlooked, as I also can help others. To not spoil anyone I placed it on a details section, so it must be opened to be seen.
My solution
Must Have
- UI
- Add a slider with range 0 - 100
- Add a label to display the target number.
- Add a hit-me up button to submit the position for evaluation.
- Add a label to display the session score (sum of rounds scores)
- Add a label to display the current round number.
- Add a popup to be displayed when the hit-me up button is tapped (and the score is evaluated and stored), with a label to display the score, a label to display a nice (or not so nice) message, and a button to start a new round.
- Code
- Create a structure to store the rounds score (the UI could be updated to reflect the sum without it needing its own variable).
- Add a method to generate a random number between 1 and 99 (0 or 100 would be an easy win).
- Add a method to calculate the round score after tapping the hit-me up button.
- Add a method to refresh the UI after tapping the new round button on the score popup.
- Add a method to display the score after tapping the hit-me up button.
Nice to Have
- Add a nice background
- Stylize the slider
- Stylize the hit me button.
- Stylize the score popup
- Add a leaderboard.