saving php5 version
This commit is contained in:
commit
c2c1ee7b9b
46 changed files with 817 additions and 0 deletions
34
globals.php
Executable file
34
globals.php
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
define("DATETIMEFORMAT","yyyy-mm-tt, HH:MM Uhr");
|
||||
|
||||
function calculate_rank($rate,$bill,$missed_games) {
|
||||
$return=0;
|
||||
$bill_factor=3000/(user_max_bill()-user_min_bill());
|
||||
$return = ($rate+$bill_factor*$bill); //50% Quote, 50% max Bill
|
||||
switch ($missed_games)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
$return *= 1;
|
||||
break;
|
||||
case 2:
|
||||
$return *= 0.8;
|
||||
break;
|
||||
case 3:
|
||||
$return *= 0.6;
|
||||
break;
|
||||
case 4:
|
||||
$return *= 0.4;
|
||||
break;
|
||||
case 5:
|
||||
$return *= 0.2;
|
||||
break;
|
||||
default:
|
||||
$return *= 0;
|
||||
}
|
||||
//$return *= (-1/5)*(($missed_games<5)? $missed_games:5) + 1;
|
||||
//$return *= exp ( -1 * $missed_games );
|
||||
$return = ($return*10) / 6; //normalize to 10000
|
||||
return ($return);
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue