diff --git a/Testings/SaveLoad/2048Data.txt b/Testings/SaveLoad/2048Data.txt index 0a7abbd5c46a52a25d35c2a96d8a1b53cd83fcef..b7ebd1cf0abf546bb5092abae9219adf784e562d 100644 --- a/Testings/SaveLoad/2048Data.txt +++ b/Testings/SaveLoad/2048Data.txt @@ -1,7 +1,12 @@ NAME SCORE -Mal 54234 -BVB 9240 -BND 6564 -CDS 6544 -NKV 5453 -KAL 2434 +Mal 54234 +bvd 10000 +vds 10000 +NEL 10000 +PHI 10000 +BAG 10000 +BVB 9240 +BND 6564 +CDS 6544 +NKV 5453 +KAL 2434 diff --git a/Testings/SaveLoad/SaveLoad.cpp b/Testings/SaveLoad/SaveLoad.cpp index 5062f75f88b6289c264e96e214c71bfabdfd5268..6d6e8c2357191ece6f635e2a81dd26d94695cac3 100644 --- a/Testings/SaveLoad/SaveLoad.cpp +++ b/Testings/SaveLoad/SaveLoad.cpp @@ -16,9 +16,12 @@ void SaveLoad::pushBackNewScoreAndSort(Scores Score){ void SaveLoad::displayScores(){ cout << "Rank" << "\t\t" << "Name" << "\t\t" << "Score" << endl; - for (int i = 0; i < 10; i ++){ - - cout << i+1 << "\t\t" << scores.at(i).getName() << "\t\t" << scores.at(i).getScore() << endl; + int i = 1; + for (auto score : scores){ + cout << i++ << "\t\t" << score.getName() << "\t\t" << score.getScore() << endl; + if(i == 11){ + break; + } } } diff --git a/Testings/SaveLoad/main.cpp b/Testings/SaveLoad/main.cpp index e66eec62b57228cfb54dd0210a7926e579143166..d5905bfcc0becbb2261771b526c8104dbe96085a 100644 --- a/Testings/SaveLoad/main.cpp +++ b/Testings/SaveLoad/main.cpp @@ -11,7 +11,7 @@ using namespace std; int main(){ //check for valid username // char userName[3]; - SLSnake second; + SL2048 second; second.LoadContainers(); second.userInputNameMakeScore(10000);