ESL Elo formula (something wrong)

zaelock

New Member
I'm trying to implement ELO formula like ESL portal have. ( http://cheater.esl.eu/uk/faq/rankmodules/ )A first example corresponds to the example of ESL but the second and third give crazy results. Where I'm wrong?\[code\] function eloEsl($k1, $k2, $g1, $g2){ $per1 = $g1 / ($g1 + $g2); $per2 = $g2 / ($g1 + $g2); $E = 1/(1+ Pow(10, -($k1-$k2)/400)); $Pts1 = $k1 + 50 * ( $per1 - $E ); $Pts2 = $k2 + 50 * ( $per2 - $E ); $Pts1 = round($Pts1); $Pts2 = round($Pts2); return array($Pts1, $Pts2);}// first test is similar to ESL exampleeloEsl(1000, 1000, 3, 6); // returns -8 / + 8// This make crazy result !eloEsl(1000, 1200, 5, 1); // returns +30 / -4// and reverseeloEsl(1000, 1200, 1, 5); // returns -4 / +30\[/code\]
 
Back
Top