https://github.com/forthright48/codeforces-rating-system
An implementation of Codeforces rating system as described on http://codeforces.com/contest/1/submission/13861109
https://github.com/forthright48/codeforces-rating-system
codeforces competitive-programming cpps elo-rating rating-system
Last synced: about 1 month ago
JSON representation
An implementation of Codeforces rating system as described on http://codeforces.com/contest/1/submission/13861109
- Host: GitHub
- URL: https://github.com/forthright48/codeforces-rating-system
- Owner: forthright48
- License: mit
- Created: 2018-01-21T16:56:08.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-30T00:22:18.000Z (almost 7 years ago)
- Last Synced: 2025-02-21T05:16:13.089Z (12 months ago)
- Topics: codeforces, competitive-programming, cpps, elo-rating, rating-system
- Language: JavaScript
- Size: 32.2 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Codeforces Rating System
A javascript implementation of CodeForces Rating system. Translated from [MikeMirzayanov's Code](http://codeforces.com/contest/1/submission/13861109)
# How to install it
```
yarn install codeforces-rating-system
```
# How to use it
```
const {getNewRatings} = require('codeforces-rating-system');
const contestants = [{
position: 1,
username: 'forthright48',
previousRating: 1500,
}, {
position: 2,
username: 'flash_7',
previousRating: 1500,
}, {
position: 2,
username: 'labib666',
previousRating: 1500,
}];
console.log(getNewRatings(contestants));
// Output
// [ { position: 1,
// username: 'forthright48',
// previousRating: 1500,
// delta: 100.87528483072916,
// newRating: 1600.8752848307292 },
// { position: 2,
// username: 'flash_7',
// previousRating: 1500,
// delta: -51.937642415364586,
// newRating: 1448.0623575846355 },
// { position: 2,
// username: 'labib',
// previousRating: 1500,
// delta: -51.937642415364586,
// newRating: 1448.0623575846355 } ]
```
# index.js vs dist.js
`dist.js` file is ES5 version of `index.js`.