Skip to content

Commit

Permalink
If there is a tie in digits, the one that completed first takes priority
Browse files Browse the repository at this point in the history
  • Loading branch information
TheComputerGeek2 committed Mar 13, 2015
1 parent 654aaff commit 1ecadfe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Pi-Day-Project/src/performance/UserAttempt.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,13 @@ public static UserAttempt loadFromStrings(String[] attemptData) {
public int compareTo(UserAttempt arg0) {
//if this is greater than arg0, positive normally
//inverted so the better attempts are at the top
int digitDifference = arg0.getDigitsCorrect() - getDigitsCorrect();
if (digitDifference != 0) {
return digitDifference;
}

return startTime.compareTo(arg0.startTime);

return arg0.getDigitsCorrect() - getDigitsCorrect();

}
}

0 comments on commit 1ecadfe

Please sign in to comment.