Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function eloCalc ($ratingA, $ratingB, $winner) {
- $qA = 10^($ratingA/400);
- $qB = 10^($ratingB/400);
- $expectedA = $qA / ($qA + $qB);
- $expectedB = $qA / ($qA + $qB);
- if ($winner == 1) { $scoreA = 1; $scoreB = 0; }
- else { $scoreA = 0; $scoreB = 1; }
- $newRatingA = $ratingA + ($c * ($scoreA - $expectedA));
- $newRatingB = $ratingB + ($c * ($scoreB - $expectedB));
- return whatever
- }
Add Comment
Please, Sign In to add comment