Skip to content

Commit

Permalink
leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Donot committed May 24, 2024
1 parent 08cd067 commit d560181
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions script/leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ async function getUsersMapCount() {
const userMapCounts = {};

// Parcourir tous les utilisateurs et compter leurs cartes
Object.keys(usersData).forEach(username => {
Object.keys(usersData).forEach(userID => {
const username = usersData[userID]["name"];
const maps = usersData[username]["maps"];
userMapCounts[username] = Object.keys(maps).length;
});
Expand All @@ -28,12 +29,6 @@ async function getUsersMapCount() {
}
}

getUsersMapCount().then(userMapCounts => {
console.log(userMapCounts); // Affiche le dictionnaire résultant
});



document.addEventListener('DOMContentLoaded', async function() {
// Example users data - this would be replaced with data from your actual source
//const users = {"Alice": 120,"Bob": 150,"Charlie": 90,"Daniel": 180,"Eve": 135};
Expand Down

0 comments on commit d560181

Please sign in to comment.