Note Submitter: sKopheK
----
i dont know what to think about this:
let say we have an array with 128 values, 78 of the are
non-zero, others zeros... i want to randomly shuffle array
so there will be one zero at most in one couple of values (i
take two values at the same time, then next two).
do {
$blank = 0;
shuffle($player);
for ($i = 0; $i < sizeof($player); $i += 2) {
if (!$player[$i] && !$player[$i + 1]) {
$blank++;
break;
}
}
}
while ($blank);
is there anything wrong, i dont know, plz HELP! (doesnt work
no matter if i use srand before or not)
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|