in reply to Making a dynamic high scores table
I'd suggest storing the high score list in a file so that when you restart the game, you still have the original values. So your subroutine to save & display high scores might be something like:
- Read high-score-list file
- Add new score, initials
- Sort list
- Write back new high-score-list to file
Optionally, if you want to keep only the top X scores, then after sorting, just write the first X items back to the new file. Also, to prevent a program problem from causing you to lose the entire list, write the new list to a different file. Once you're done, then you can rename the original to original.bak, and then rename the new file to the original name.
When your only tool is a hammer, all problems look like your thumb.