0.1.0 • Published 6 years ago

soccer-elo v0.1.0

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

Soccer-ELO

Build Status

Intro

Soccer-ELO is a very small library that calculates ELO-Ratings for Soccer games and games with similar scoring results (e.g. Foosball, Hockey).

With ELO-Ratings every team or player starts with 1000 points. Each game results in the winner getting points from the looser. The algorithm compares the result of a game to the win expectancy of the game (e.g. 50/50 if both teams have the same points). For a more detailed explanation see here.

Usage

import { calcEloChange } from 'soccer-elo'

// the current points of team1 and team2
const currentTeamPoints = [1000, 1000]
// the score of the game
const score = [1, 0]

const eloChange = calcEloChange (currentTeamPoints, score)

const newTeamPoints = [currentTeamPoints[0] + score, currentTeamPoints[1] + score]
0.1.0

6 years ago