diff --git a/four_pupils/index.html b/four_pupils/index.html index 5fafb9b..8ed983a 100644 --- a/four_pupils/index.html +++ b/four_pupils/index.html @@ -9,7 +9,7 @@

Repository Pages

- + \ No newline at end of file diff --git a/four_pupils/script.js b/four_pupils/script.js new file mode 100644 index 0000000..0271ac1 --- /dev/null +++ b/four_pupils/script.js @@ -0,0 +1,76 @@ +const users = [ + { name: 'Emmanuel', handle: 'OsazuwaEmmanuel', rating: 541 }, + { name: 'Genesis', handle: 'daveshub', rating: 783 }, + { name: 'Minerva', handle: 'Minerva2005', rating: 932 }, + { name: 'Turing_apple', handle: 'Turing_apple', rating: 847 }, + { name: 'python_tamer', handle: 'python_tamer', rating: 1107 }, + { name: 'cyberdude', handle: 'cyberdude', rating: 742 }, + { name: 'cryptickid91', handle: 'cryptickid91', rating: 566 }, + {name: 'randombernie', handle: 'randombernie', rating: 1149}, + {name: 'dreadedhippy', handle: 'dreadedhippy', rating:1161}, + {name: '0x000022', handle: '0x000022', rating: 1107} + // Hey there, you can add your data here +]; +const pts = [ + {name: 'ehijoe', handle: 'ehijoe', rating: 1332} +] +async function populateTable() { +const tableBody = document.getElementById('ratingTableBody'); +const sortedUsers = users.sort((a, b) => b.rating - a.rating); +let uid = 1; +sortedUsers.forEach(user => { + const adjustedRating = 1200 - user.rating; // Calculate adjusted rating + const profileLink = `https://codeforces.com/profile/${user.handle}`; // Codeforces profile link + const row = `${uid}${user.name}${user.rating}${adjustedRating}Profile`; + tableBody.insertAdjacentHTML('beforeend', row); + ++uid; +}); +const tableBody_pts = document.getElementById('ptsb'); +const sortedUsers_pts = pts.sort((a, b) => b.rating - a.rating); +uid = 1; +sortedUsers_pts.forEach(pts => { + const adjustedRating_pts = 1400 - pts.rating; // Calculate adjusted rating + const profileLink_pts = `https://codeforces.com/profile/${pts.handle}`; // Codeforces profile link + const row_pts = `${uid}${pts.name}${pts.rating}${adjustedRating_pts}Profile`; + tableBody_pts.insertAdjacentHTML('beforeend', row_pts); + ++uid; +}); +} +window.onload = populateTable; + +const users_archive = [ + [ + { name: 'Emmanuel', handle: 'OsazuwaEmmanuel', rating: 629 }, + { name: 'Genesis', handle: 'daveshub', rating: 783 }, + { name: 'Minerva', handle: 'Minerva2005', rating: 932 }, + { name: 'Turing_apple', handle: 'Turing_apple', rating: 847 }, + { name: 'python_tamer', handle: 'python_tamer', rating: 1107 }, + { name: 'cyberdude', handle: 'cyberdude', rating: 742 }, + { name: 'cryptickid91', handle: 'cryptickid91', rating: 566 }, + {name: 'randombernie', handle: 'randombernie', rating: 1160}, + {name: '0x000022', handle: '0x000022', rating: 1107} + // Hey there, you can add your data here + ], + [//30th April 2024 + { name: 'Emmanuel', handle: 'OsazuwaEmmanuel', rating: 541 }, + { name: 'Genesis', handle: 'daveshub', rating: 783 }, + { name: 'Minerva', handle: 'Minerva2005', rating: 932 }, + { name: 'Turing_apple', handle: 'Turing_apple', rating: 847 }, + { name: 'python_tamer', handle: 'python_tamer', rating: 1107 }, + { name: 'cyberdude', handle: 'cyberdude', rating: 742 }, + { name: 'cryptickid91', handle: 'cryptickid91', rating: 566 }, + {name: 'randombernie', handle: 'randombernie', rating: 1149}, + {name: 'dreadedhippy', handle: 'dreadedhippy', rating:1161}, + {name: '0x000022', handle: '0x000022', rating: 1107} + // Hey there, you can add your data here + ] +] +const pts_archive = [ + [ + {name: 'dreadedhippy', handle: 'dreadedhippy', rating:1256}, + {name: 'ehijoe', handle: 'ehijoe', rating: 1305} + ], + [//30th April 2024 + {name: 'ehijoe', handle: 'ehijoe', rating: 1332} + ] +] \ No newline at end of file diff --git a/get_unsolved_and_solved_problems.html b/get_unsolved_and_solved_problems.html index 7b2e8a9..80775c7 100644 --- a/get_unsolved_and_solved_problems.html +++ b/get_unsolved_and_solved_problems.html @@ -9,7 +9,7 @@

Repository Pages