ELO Calculator
This package makes using the ELO ranking system easy. To get started you just need to decide what you want your starting ELO. After that, you can start calculating win probabilities based on two player's ELO scores and also determining the ELO of a player after a match.
It's very simple.
Installation
To install this package.
npm i toefungi-elo-calculator
Usage
You're first going to want to import the relevant files and instantiate a new instance of the EloCalculator
.
Here is a basic example of calculating a new ELO value.
// Declared player variables // Calculate ELO based on the outcome of the game without taking into account // Player performance or the score difference in the gameeloCalculator.calculateEloplayerElo, opponentElo, ScoringBonus.WIN .then // Take into account the numerical difference in the score to determine the ELO// This will make the ELO change more dynamic as it computes slightly differently// And will more accurately split the higher players from the lower players// In terms of their ELO eloCalculator.calculateEloplayerElo, opponentElo, ScoringBonus.WIN, scoreDiff .then
Here is a basic example of calculating win probabilities between two players.
// Declared player variables // Calculate ELO based on the outcome of the gameeloCalculator.caluclateWinProbabilityplayerElo, opponentElo .then
Testing
This package includes unit tests which cover 100% of the code and all tests are working.
The testing framework being used is mocha
and using chai-as-promised
to test the promise returns from the package.
The test suite can be run using the conventional npm test
The package uses nyc
for code coverage.