Skip to content

Instantly share code, notes, and snippets.

@mdashlw
Created March 16, 2023 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdashlw/bd72d8480ef5caeb7ef141be9ac76c9d to your computer and use it in GitHub Desktop.
Save mdashlw/bd72d8480ef5caeb7ef141be9ac76c9d to your computer and use it in GitHub Desktop.
Hypixel Ranked SkyWars rating calculator. Same algorithm as used by Wrench; 100% accurate.
const args = process.argv.slice(2);
const oldRating = parseInt(args[0]);
const newRating = parseInt(args[1]);
var rating = oldRating;
var wins = 0;
while (rating < newRating) {
if (rating <= 450) {
var win = 50;
} else if (rating >= 2000) {
var win = 10;
} else {
var win = 50 - Math.trunc(rating / 100) * 2;
}
console.log(`Win on ${rating}: ${win}`);
rating += win;
wins += 1;
}
console.log(`Wins: ${wins}`)
console.log(`Rating: ${rating}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment