Commit 0c950b47 authored by Kyle Malaguit's avatar Kyle Malaguit

autosave

parent caa566d6
......@@ -61,5 +61,13 @@ void SaveLoad::printScoreIfLessThan10(Scores findScore){
cout << "Score not found" << endl;
}
// cout << iter << " " << scores.at(iter).getName << " " << scores.at(iter).getScore << endl;
}
void SaveLoad::useRankFindScore(int rank){
if(rank >= scores.size() || rank <= 0){
cout << "Outside of total scores..." << endl;
return;
}
Scores foundScore = scores.at(rank - 1);
cout << "At rank " << rank << " player " << foundScore.getName() << " has a score of " << foundScore.getScore() << endl;
}
\ No newline at end of file
......@@ -32,6 +32,7 @@ class SaveLoad {
void printScoreIfLessThan10(Scores);
//one that passes a position and returns the line in the vector
void useRankFindScore(int rank);
//function for comparing
static bool sortAscending(Scores, Scores);
......
......@@ -20,6 +20,11 @@ int main(){
Scores fScore("cdo", 21474);
second.printScoreIfLessThan10(fScore);
second.useRankFindScore(0);
second.useRankFindScore(100);
second.useRankFindScore(9);
second.useRankFindScore(5);
return 0;
}
......
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