Skip to content

Commit

Permalink
Update Leaderboard.java
Browse files Browse the repository at this point in the history
  • Loading branch information
uta-1001966434 authored Jul 29, 2024
1 parent c2c5ab3 commit 8c005aa
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/main/java/uta/cse3310/Leaderboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,5 @@ public String toString() {
return playerName + ": " + score;
}
}

// Test the Leaderboard class
public static void main(String[] args) {
Leaderboard lb = new Leaderboard();
lb.addScore("Alice", 100);
lb.addScore("Bob", 200);
lb.addScore("Charlie", 150);
lb.addScore("Diana", 180);
lb.addScore("Eve", 130);
lb.addScore("Frank", 220); // This should replace the lowest score (Alice)

List<PlayerScore> topScores = lb.getTopScores();
for (PlayerScore ps : topScores) {
System.out.println(ps);
}
}
}

0 comments on commit 8c005aa

Please sign in to comment.