From e2a1f429a0875ea865fc36ceea491cf8406a9166 Mon Sep 17 00:00:00 2001 From: vincenttrinh3336 <158768889+vincenttrinh3336@users.noreply.github.com> Date: Mon, 29 Apr 2024 22:50:42 +0000 Subject: [PATCH] logic error fix --- src/main/java/uta/cse3310/Leaderboard.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/uta/cse3310/Leaderboard.java b/src/main/java/uta/cse3310/Leaderboard.java index eb90b29..4b80468 100644 --- a/src/main/java/uta/cse3310/Leaderboard.java +++ b/src/main/java/uta/cse3310/Leaderboard.java @@ -17,7 +17,7 @@ public Leaderboard() { public void add(String handle, int score) { LB.put(handle, score); scores.add(score); - Collections.sort(scores); + Collections.sort(scores, reverseOrder()); if(scores.indexOf(score) > names.size()) { names.add(handle); @@ -36,7 +36,7 @@ public void update(String handle, int score) names.remove(i); scores.remove(i); scores.add(new_score); - Collections.sort(scores); + Collections.sort(scores, reverseOrder()); if(scores.indexOf(new_score) > names.size()) { names.add(handle);