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.
Diff: SavedGames/SavedGames.cpp
- Revision:
- 85:87bc28b151d8
- Parent:
- 82:3211b31e9421
diff -r f61c85a5f13a -r 87bc28b151d8 SavedGames/SavedGames.cpp
--- a/SavedGames/SavedGames.cpp Tue May 26 14:39:45 2020 +0000
+++ b/SavedGames/SavedGames.cpp Tue May 26 19:38:48 2020 +0000
@@ -10,7 +10,7 @@
bool SavedGames::save_test(Direction d_,SDFileSystem &sd, N5110 &lcd) {
- // Objects reqired for test
+ // Objects required for test
printf("Data save = %d : ",d_);
@@ -26,7 +26,7 @@
add_saved_data(sd, input_data, lcd);
- // Deffine outut data object
+ // Define output data object
SavedGamesData output_data;
output_data = read_saved_data(sd, lcd);
@@ -48,7 +48,7 @@
printf ("\nTesting save_test() \n\n");
int passed_counter = 0;
- // Runs test with all differnt possible inputs
+ // Runs test with all different possible inputs
if (save_test(CENTRE, sd, lcd)) passed_counter++;
if (save_test(N, sd, lcd)) passed_counter++;
if (save_test(NE, sd, lcd)) passed_counter++;
@@ -106,7 +106,7 @@
check_sd_present(sd,lcd);
FILE *fp;
- // Overwiretes selected save file
+ // Overwrites selected save file
if (display_data_number_ == 1) {
fp = fopen("/sd/SavedGamesOne.csv", "w");
// printf ("save1 \n");
@@ -127,7 +127,7 @@
// printf ("adddata.smart_bombs = %d \n", data.smart_bombs);
// printf ("add data.alien_number = %d \n", data.lives);
- // Adda data to file if no error
+ // Adds data to file if no error
fprintf(fp, "%d,%d,%d,%d\n", data.score, data.lives, data.smart_bombs,
data.alien_number);
fclose(fp);
@@ -140,7 +140,7 @@
FILE *fp;
SavedGamesData data;
- // Opens diplayed file
+ // Opens displayed file
if (display_data_number_ == 1) {
fp = fopen("/sd/SavedGamesOne.csv", "r");
//printf ("open save1\n");
@@ -159,7 +159,7 @@
// Reads saved data into object
}else{
- // Read save file and add values to data objecy
+ // Read save file and add values to data object
fscanf(fp, "%d,%d,%d,%d",&data.score, &data.lives,&data.smart_bombs,
&data.alien_number);
@@ -206,11 +206,11 @@
void SavedGames::saved_games_scroll(Direction d_) {
- // Changes displayed manu part depending on joystick input
+ // Changes displayed menu part depending on joystick input
if (d_ == N || d_ == NE || d_ == NW ) {
display_data_number_++;
- // Loops back round when at end of saved game vecotr
+ // Loops back round when at end of saved game vector
if(display_data_number_ > 3) {
display_data_number_ = 1;
}
@@ -226,4 +226,4 @@
int SavedGames::get_display_data_number() {
return display_data_number_;
-}
\ No newline at end of file
+}