I'm making a highscores list for my 2048 replica. An entry in the list consists of a name and a score (e.g. "John" and 2100.) When I add a new entry, the code runs through the list and inserts the new entry when the score for the new entry is greater than the currently indexed entry. So imagine this list:
Roman 17000
Sergei 12500
Dean 8000
Andrew 1400
If John was inserted into the list, the new list would look like:
Roman 17000
Sergei 12500
Dean 8000
John 2100
Andrew 1400
The question is, what do I do when inserting the entry for "Steve" whose score is 8000. Does he go before or after Dean? Is there a convention for this?