Skip to content

Commit

Permalink
Updated structure of four_pupils, Created users/pts archives.
Browse files Browse the repository at this point in the history
  • Loading branch information
Osalotioman committed Apr 30, 2024
1 parent 3bd5ffe commit d10447f
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 45 deletions.
44 changes: 2 additions & 42 deletions four_pupils/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h2>Repository Pages</h2>
<ul>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/">HomePage</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils.html">Four Pupils by May</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils">Four Pupils by May</a></li>
<li><a href="https://github.com/OsazuwaEmmanuel/ncp_community">Github Repo</a></li>
<li><a href="https://docs.google.com/spreadsheets/d/1EMK2fXn6rR_q4wJV4fU-CR55GBwVqwWYESp7DDpYD4U/edit?usp=sharing">Updating Upsolves</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/get_unsolved_and_solved_problems.html">Get Unsolved and Solved Problems of Codeforces User</a></li>
Expand Down Expand Up @@ -53,46 +53,6 @@ <h3> Pupil to Specialist </h3>
<li>Raise an issue <a href="https://github.com/OsazuwaEmmanuel/ncp_community/issues">here</a>. Or</li>
<li>Start a discussion <a href="https://github.com/OsazuwaEmmanuel/ncp_community/discussions">here</a>.</li>
</ul>
<script>
const users = [
{ 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
];
const pts = [
{name: 'dreadedhippy', handle: 'dreadedhippy', rating:1256},
{name: 'ehijoe', handle: 'ehijoe', rating: 1305}
]
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;
</script>
<script src="script.js"></script>
</body>
</html>
76 changes: 76 additions & 0 deletions four_pupils/script.js
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}
]
]
2 changes: 1 addition & 1 deletion get_unsolved_and_solved_problems.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h2>Repository Pages</h2>
<ul>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/">HomePage</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils.html">Four Pupils by May</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils">Four Pupils by May</a></li>
<li><a href="https://github.com/OsazuwaEmmanuel/ncp_community">Github Repo</a></li>
<li><a href="https://docs.google.com/spreadsheets/d/1EMK2fXn6rR_q4wJV4fU-CR55GBwVqwWYESp7DDpYD4U/edit?usp=sharing">Updating Upsolves</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/get_unsolved_and_solved_problems.html">Get Unsolved and Solved Problems of Codeforces User</a></li>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h2>Repository Pages</h2>
<ul>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/">HomePage</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils.html">Four Pupils by May</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils">Four Pupils by May</a></li>
<li><a href="https://github.com/OsazuwaEmmanuel/ncp_community">Github Repo</a></li>
<li><a href="https://docs.google.com/spreadsheets/d/1EMK2fXn6rR_q4wJV4fU-CR55GBwVqwWYESp7DDpYD4U/edit?usp=sharing">Updating Upsolves</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/get_unsolved_and_solved_problems.html">Get Unsolved and Solved Problems of Codeforces User</a></li>
Expand Down
2 changes: 1 addition & 1 deletion resources.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<h2>Repository Pages</h2>
<ul>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/">HomePage</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils.html">Four Pupils by May</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/four_pupils">Four Pupils by May</a></li>
<li><a href="https://github.com/OsazuwaEmmanuel/ncp_community">Github Repo</a></li>
<li><a href="https://docs.google.com/spreadsheets/d/1EMK2fXn6rR_q4wJV4fU-CR55GBwVqwWYESp7DDpYD4U/edit?usp=sharing">Updating Upsolves</a></li>
<li><a href="https://osazuwaemmanuel.github.io/ncp_community/get_unsolved_and_solved_problems.html">Get Unsolved and Solved Problems of Codeforces User</a></li>
Expand Down

0 comments on commit d10447f

Please sign in to comment.