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: BrickBreaker_Engine/BrickBreakerEngine.cpp
- Revision:
- 35:138ad0faa42b
- Parent:
- 34:7e03391cb8a6
- Child:
- 38:a85bc227b907
--- a/BrickBreaker_Engine/BrickBreakerEngine.cpp Tue Apr 30 10:55:22 2019 +0000 +++ b/BrickBreaker_Engine/BrickBreakerEngine.cpp Sat May 04 18:56:38 2019 +0000 @@ -64,7 +64,7 @@ int i = 0; rewind(fp); - while(fscanf(fp, "%d,%f", &index_array[i], &array_of_values[i]) != EOF){ + while(fscanf(fp, "%d,%f", &_index_array[i], &_array_of_values[i]) != EOF){ i++; } fclose(fp); @@ -74,9 +74,9 @@ void BrickBreakerEngine::check_high_score(){ read_high_scores(); for(int i = 4; i >= 0; i--){ - if(array_of_values[i] < _score){ - array_of_values[i+1] = array_of_values[i]; - array_of_values[i] = _score; + if(_array_of_values[i] < _score){ + _array_of_values[i+1] = _array_of_values[i]; + _array_of_values[i] = _score; } } } @@ -89,7 +89,7 @@ printf("Error: Could not open file"); } else { for(int i = 0; i < 5; i++){ - fprintf(fp, "%d, %f\n", index_array[i], array_of_values[i]); + fprintf(fp, "%d, %f\n", _index_array[i], _array_of_values[i]); } fclose(fp); } @@ -130,8 +130,4 @@ lcd.refresh(); wait(0.2); } -} - -int BrickBreakerEngine::compare( const void * a, const void * b){ - return( *(int *) a - *(int *) b); - } \ No newline at end of file +} \ No newline at end of file