projects
/
e-DoKo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
517aa18
)
NEW FEATURE: use a better random generator
author
Arun Persaud
<arun@nubati.net>
Thu, 19 Jul 2007 05:21:43 +0000
(22:21 -0700)
committer
Arun Persaud
<arun@nubati.net>
Thu, 19 Jul 2007 05:21:43 +0000
(22:21 -0700)
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 ;)
functions.php
patch
|
blob
|
history
diff --git
a/functions.php
b/functions.php
index e30c81753fc74485eb301f174f5fa07d48d32e64..2d2277b4da4feeebc143ac06695d6ba6a26e7dfc 100644
(file)
--- 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;