Skip to content

Commit

Permalink
trying new method
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenttrinh3336 committed Apr 29, 2024
1 parent b834aee commit 44c2fe8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/uta/cse3310/Leaderboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ public void update(String handle, int score)
{
int new_score = score + LB.get(handle);
LB.put(handle, new_score);
scores.remove(score);
names.remove(handle);
int i = names.indexOf(handle);
names.remove(i);
scores.remove(i);
scores.add(new_score);
Collections.sort(scores);
if(scores.indexOf(new_score) >= names.size())
Expand Down

0 comments on commit 44c2fe8

Please sign in to comment.