From 29e356ef0ea4b3ba7da560ab87448b1d2f5b7d7d Mon Sep 17 00:00:00 2001 From: Kyle Malaguit Date: Tue, 12 Mar 2019 02:48:44 +0000 Subject: [PATCH] autosave --- Testings/SaveLoad/2048Data.txt | 17 +++++++++++------ Testings/SaveLoad/SaveLoad.cpp | 9 ++++++--- Testings/SaveLoad/main.cpp | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Testings/SaveLoad/2048Data.txt b/Testings/SaveLoad/2048Data.txt index 0a7abbd..b7ebd1c 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 5062f75..6d6e8c2 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 e66eec6..d5905bf 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); -- GitLab