ferranfg/elo-rating

此软件包的最新版本(1.2.0)没有可用的许可信息。

PHP 实现的 Elo 积分系统

1.2.0 2023-01-11 15:23 UTC

This package is auto-updated.

Last update: 2024-09-04 07:47:16 UTC


README

一个 PHP 类,实现了 Elo 积分系统,用于 Fantasy Padel Tour

使用 composer 安装

composer require ferranfg/elo-rating

链接到 Packagist.org: https://packagist.org.cn/packages/ferranfg/elo-rating

用法

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'];

致谢

Creative Commons License
Elo Rating PHPMichal Chovanec 根据 Creative Commons Attribution 4.0 International License 许可。