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.
Fork of el17z2q by
Diff: Bag/Hscore-test.h
- Branch:
- GameEngine
- Revision:
- 2:6dc7bc55c1cb
- Parent:
- 1:00a4ea97c4cd
--- a/Bag/Hscore-test.h Mon May 07 21:24:25 2018 +0000 +++ b/Bag/Hscore-test.h Mon May 07 22:11:43 2018 +0000 @@ -11,26 +11,29 @@ */ bool GetHscore_test_value() { - // Initialise bag object with a width of 18, height of 2 and speed of 1 + // Just quote the get_Hscore() function Bag bag; + // int score 5 firstly int test_score_1 = 5; + // get the score bag.add_score(test_score_1); int read_Hscroe_1 = bag.get_Hscore(); printf("%f", read_Hscore_1); + // then int score 3 int test_score_2 = 3; bag.add_score(test_score_2); int read_Hscroe_2 = bag.get_Hscore(); printf("%f", read_Hscore_2); - // Update the position + // Update the score bag.update(); - // Now check that both the positions are as expected + // Now check that both the scores are as expected bool success = true; - // Fail the test if the initial position is wrong + // Fail the test if the score is wrong if (read_Hscroe_1 != 5) { success = false; }