Skip to content

Instantly share code, notes, and snippets.

@Devhobby
Created December 6, 2018 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Devhobby/f5077cde0414c1f674f7b64d95546fb5 to your computer and use it in GitHub Desktop.
Save Devhobby/f5077cde0414c1f674f7b64d95546fb5 to your computer and use it in GitHub Desktop.
scoreboard
ScoreBoard::ScoreBoard() : filestatus(true) {
std::ifstream scoreFile("score.dat");
if (!scoreFile.is_open()) {
filestatus = false;
for (auto &i : score)
i = 0;
} else {
for (auto &i : score)
scoreFile >> i;
std::sort(score, score + 10, std::greater<>());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment