Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 8 hours 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 (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-18T10:50:38.000Z (about 9 years ago)
- Last Synced: 2025-01-10T00:06:56.968Z (11 days ago)
- Topics: elo, elo-score
- Language: PHP
- Size: 13.7 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# elo-score-calculator
[![Build Status (Scrutinizer)](https://scrutinizer-ci.com/g/Jleagle/elo-score-calculator/badges/build.png)](https://scrutinizer-ci.com/g/Jleagle/elo-score-calculator)
[![Code Quality (scrutinizer)](https://scrutinizer-ci.com/g/Jleagle/elo-score-calculator/badges/quality-score.png)](https://scrutinizer-ci.com/g/Jleagle/elo-score-calculator)
[![Latest Stable Version](https://poser.pugx.org/Jleagle/elo-score-calculator/v/stable.png)](https://packagist.org/packages/Jleagle/elo-score-calculator)
[![Latest Unstable Version](https://poser.pugx.org/Jleagle/elo-score-calculator/v/unstable.png)](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();
```