https://github.com/jleagle/elo-score-calculator
A PHP class to generate points using an ELO rating system
https://github.com/jleagle/elo-score-calculator
elo elo-score
Last synced: 6 months ago
JSON representation
A PHP class to generate points using an ELO rating system
- Host: GitHub
- URL: https://github.com/jleagle/elo-score-calculator
- Owner: Jleagle
- Created: 2014-04-16T22:21:45.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-18T10:50:38.000Z (almost 10 years ago)
- Last Synced: 2025-03-25T23:13:46.908Z (7 months ago)
- Topics: elo, elo-score
- Language: PHP
- Size: 13.7 KB
- Stars: 8
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# elo-score-calculator
[](https://scrutinizer-ci.com/g/Jleagle/elo-score-calculator)
[](https://scrutinizer-ci.com/g/Jleagle/elo-score-calculator)
[](https://packagist.org/packages/Jleagle/elo-score-calculator)
[](https://packagist.org/packages/Jleagle/elo-score-calculator)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```php
$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
```php
$expectedScore = $elo->getExpected();
```Get the players new scores
```php
$newRatings = $elo->getRatings();
```