An open API service indexing awesome lists of open source software.

https://github.com/ferranfg/elo-rating

Librería PHP para calcular y gestionar ratings Elo en equipos y parejas, optimizada para competiciones y ligas
https://github.com/ferranfg/elo-rating

Last synced: 5 months ago
JSON representation

Librería PHP para calcular y gestionar ratings Elo en equipos y parejas, optimizada para competiciones y ligas

Awesome Lists containing this project

README

          

# Elo Rating PHP
A PHP class which implements the [Elo rating system](http://en.wikipedia.org/wiki/Elo_rating_system) for [Fantasy Padel Tour](https://fantasypadeltour.com).

# Install with composer

`composer require ferranfg/elo-rating`

Link to Packagist.org: https://packagist.org/packages/ferranfg/elo-rating

# Usage

require 'src/Rating/Rating.php';

// player A elo = 1000
// player B elo = 2000
// player A lost
// player B win

$rating = new Rating(1000, 2000, Rating::LOST, Rating::WIN);

// player A elo = 1000
// player B elo = 2000
// player A draw
// player B draw

$rating = new Rating(1000, 2000, Rating::DRAW, Rating::DRAW);

$results = $rating->getNewRatings();

echo "New rating for player A: " . $results['a'];
echo "New rating for player B: " . $results['b'];

---------------------------------------

# Credits

Creative Commons License
Elo Rating PHP by Michal Chovanec is licensed under a Creative Commons Attribution 4.0 International License.