Commit e8d9c884 authored by Kyle Malaguit's avatar Kyle Malaguit

autosave

parent bb95deef
......@@ -14,11 +14,11 @@ void SaveLoad::pushBackNewScoreAndSort(Scores Score){
}
void SaveLoad::displayScores(){
cout << "Rank Name Score" << endl;
int i = 1;
cout << "Rank" << "\t\t" << "Name" << "\t\t" << "Score" << endl;
for (auto score : scores){
cout << i++ << "\t" << score.getName() << "\t" << score.getScore() << endl;
for (int i = 0; i < 10; i ++){
cout << i+1 << "\t\t" << scores.at(i).getName() << "\t\t" << scores.at(i).getScore() << endl;
}
}
......@@ -30,7 +30,7 @@ void SaveLoad::userInputNameMakeScore(int intScore){
try{
cin >> userNameInput;
if(strlen(userNameInput) != 3){
throw runtime_error("Invalid User Name input ! \n");
throw runtime_error("Invalid User Name input! \n");
}
break;
......
......@@ -13,23 +13,7 @@ int main(){
// char userName[3];
SLSnake second;
second.LoadContainers();
// cout << "Enter a username with a length of 3 characters\n";
// cin >> userName;
// //here is a temporary score input system
// //in the final project the score will be taken automatically from the system.
// int score;
// cout << "Enter a score: ";
// cin >> score;
// cout << endl;
// Scores score1(userName, score);
// second.pushBackNewScoreAndSort(score1);
// second.updateFile();
// second.displayScores();
second.userInputNameMakeScore(9999);
second.userInputNameMakeScore(10000);
second.updateFile();
second.displayScores();
......
......@@ -2,10 +2,13 @@ NAME SCORE
nge 654346
vfd 45365
cdn 21474
bbb 9999
ooo 10000
LOP 10000
vfr 9999
ddd 9999
Kyl 9999
PPP 9999
bbb 9999
vfd 4636
vev 4536
DVS 3423
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment