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
- Host: GitHub
- URL: https://github.com/ferranfg/elo-rating
- Owner: ferranfg
- Fork: true (Chovanec/elo-rating)
- Created: 2023-01-11T14:26:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-04T06:02:57.000Z (over 2 years ago)
- Last Synced: 2025-05-05T21:08:13.931Z (about 1 year ago)
- Language: PHP
- Homepage: https://fantasypadeltour.com
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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

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