diff options
author | Arun Persaud <arun@nubati.net> | 2007-07-18 22:21:43 -0700 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2007-07-18 22:21:43 -0700 |
commit | 1332ef44c9587295fe054c73415d405247fb297d (patch) | |
tree | 081071f4c902c954de86d760735fa0c3ec5b0470 | |
parent | 517aa187eccce14d5f56df5bb3a9a17056da6661 (diff) | |
download | e-DoKo-1332ef44c9587295fe054c73415d405247fb297d.tar.gz e-DoKo-1332ef44c9587295fe054c73415d405247fb297d.tar.bz2 e-DoKo-1332ef44c9587295fe054c73415d405247fb297d.zip |
NEW FEATURE: use a better random generator
people complained about too many solos ;) so I changed
from the standard php random generator to a better one.
Not sure if that solves the problem though ;)
-rw-r--r-- | functions.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/functions.php b/functions.php index e30c817..2d2277b 100644 --- a/functions.php +++ b/functions.php @@ -320,7 +320,14 @@ function create_array_of_random_numbers($useridA,$useridB,$useridC,$useridD) for($i=0;$i<48;$i++) $r[$i]=$i+1; - shuffle($r); + /* shuffle using a better random generator than the standard one */ + for ($i = 0; $i <48; $i++) + { + $j = @mt_rand(0, $i); + $tmp = $r[$i]; + $r[$i] = $r[$j]; + $r[$j] = $tmp; + } }; return $r; |