Login   Register  
PHP Classes
elePHPant
Icontem

seems overly complicated with all those conditionals.

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      ELO Calculator  >  All threads  >  seems overly complicated with all those conditionals.  >  (Un) Subscribe thread alerts  
Subject:seems overly complicated with all those conditionals.
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 those conditionals.   Reply  
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);