PHP Classes

seems overly complicated with all those conditionals.

Recommend this page to a friend!

      ELO Calculator  >  All threads  >  seems overly complicated with all...  >  (Un) Subscribe thread alerts  
Subject:seems overly complicated with all...
Summary:Package rating comment
Messages:1
Author:Stephen Young
Date:2010-10-21 20:31:43
 

Stephen Young rated this package as follows:

Utility: Sufficient
Consistency: Good
Documentation: Good
Examples: Sufficient

  1. seems overly complicated with all...   Reply   Report abuse  
Picture of Stephen Young Stephen Young - 2010-10-21 20:31:52
seems overly complicated with all those conditionals.

This should work fine for all cases:
$expected_result = 1 / (1 + pow(10, (($score - $opponent_score) / 400)));
$new_score = $score + 10 * (($win_lose_or_draw) - $expected_result);