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: N5110 PinDetect PowerControl mbed
Global.cpp
00001 #include "Global.h" 00002 00003 /// @file Global.cpp 00004 00005 namespace Global 00006 { 00007 int score = 0; 00008 Highscore highscores[3] = {{"AAA", 0}, {"AAA", 0}, {"AAA", 0}}; 00009 00010 void clearHighscoreList() 00011 { 00012 // Clear high score list 00013 for (int i = 0; i < 3; ++i) 00014 { 00015 highscores[i].initials = "---"; 00016 highscores[i].score = 0; 00017 } 00018 00019 // Overwrite file 00020 FILE *fp = fopen("/local/highscores.txt", "w"); 00021 00022 for (int i = 0; i < 3; ++i) 00023 fprintf(fp, "%s %d ", Global::highscores[i].initials, Global::highscores[i].score); 00024 00025 fclose(fp); 00026 } 00027 }
Generated on Tue Jul 12 2022 21:59:47 by
1.7.2