-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated structure of four_pupils, Created users/pts archives.
- Loading branch information
1 parent
3bd5ffe
commit d10447f
Showing
5 changed files
with
81 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = `<tr><td>${uid}</td><td>${user.name}</td><td>${user.rating}</td><td>${adjustedRating}</td><td><a href="${profileLink}" target="_blank">Profile</a></td></tr>`; | ||
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 = `<tr><td>${uid}</td><td>${pts.name}</td><td>${pts.rating}</td><td>${adjustedRating_pts}</td><td><a href="${profileLink_pts}" target="_blank">Profile</a></td></tr>`; | ||
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} | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters