Skip to content

Forensor/elo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Elo

A simple ELO system lib.

Installation

To install the latest version:

# NPM
npm i simplelo

Documentation

This library only has three functions.

expected(playerRating: number, rivalRating: number): number

Calculates the expected match outcome.

import { expected } from 'elo.js'

expected(1200, 1400) // -> 0.24
// 1200 player has 24% chance to win.

newRating(playerRating: number, rivalRating: number, score: number): number

Gets the new rating of the target player.

import { newRating } from 'elo.js'

newRating(1200, 1400, 1) // -> 1224

ratingDifference(playerRating: number, rivalRating: number, score: number): number

Gets the rating difference of the target player.

import { ratingDifference } from 'elo.js'

ratingDifference(1200, 1400, 1) // -> 24

About

A simple ELO system lib πŸ“–

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published