Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.24 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.24 KB

elo-score-calculator

Build Status (Scrutinizer) Code Quality (scrutinizer) Latest Stable Version Latest Unstable Version

Calculate expected score and new ELO score

Usage

Add Elo to your composer.json

{
    "require": {
        "jleagle/elo-score-calculator": "*"
    }
}

Download the package

$ php composer.phar update jleagle/elo-score-calculator

Give Elo the players current scores and who won/lost/drew

$elo = new Elo(
  90, 60, Elo::WIN, Elo::LOST
);

$elo = new Elo(
  90, 90, Elo::DRAW, Elo::DRAW
);

Get the chance of each player winning

$expectedScore = $elo->getExpected();

Get the players new scores

$newRatings = $elo->getRatings();