Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Scores/Scores.cpp
- Revision:
- 21:44e87d88afe2
- Parent:
- 17:cb39d9fa08dc
- Child:
- 22:9e9685856ce1
--- a/Scores/Scores.cpp Tue May 07 12:42:15 2019 +0000 +++ b/Scores/Scores.cpp Thu May 09 13:10:16 2019 +0000 @@ -17,7 +17,7 @@ } -float Scores::score_calculator(int turns, int health) +float Scores::score_calculator(int turns, int health) // Calculates score { float new_score = health * 100 / turns; _add_to_top_scores(new_score); @@ -48,8 +48,8 @@ lcd.printString(buffer, 45, 4); } -void Scores::_add_to_top_scores(float new_score) -{ +void Scores::_add_to_top_scores(float new_score) // Ranks the top scores in descending +{ // order in an array if (new_score > _top_three[0]) { _top_three[2] = _top_three[1]; _top_three[1] = _top_three[0];