I've created this program that will assemble a leaderboard array that will store scores from a game with the usernames beside the score. This leaderboard is constantly being updated everytime the game is played. These scores are appended into a text file, and the contents of the text file is entered into the leaderboard array. I want to sort this array so that the scores are descending, of course with the player name beside the corresponding score. The array looks something like this:
|User1, 9.0, 2, 0|User2, 8.0, 0, 1|User3, 8.5, 0, 1
So the format for this array goes like this:
|Username1, totalscore, wins, losses | Username2 , totalscore, wins, losses ect...
How would I sort this array so that the user with the highest score will appear first in the array and display it? I've heard that merge sort is easiest, but is this true? I appreciate any help!