<?php
function make_seed()
{
return (double)microtime()*1000000;
}
mt_srand(make_seed());
while ($count < 10000)
{
$randomize = $randomize + mt_rand(1,10);
$count = $count + 1;
}
print $randomize;
print("<br>");
while ($count < 10000)
{
$randomize = $randomize + mt_rand(1,10);
$count = $count + 1;
}
print $randomize;
print("<br>");
while ($count < 10000)
{
$randomize = $randomize + mt_rand(1,10);
$count = $count + 1;
}
print $randomize;
?>
check een werkend voorbeeld op http://www.needforgaming.com/test.php
Waarom doet ie NIKS bij de 2e en 3e loop?
Ik wil dat ie weer nieuwe randomwaardes gaat maken.. maar hoe doe ik dat?
function make_seed()
{
return (double)microtime()*1000000;
}
mt_srand(make_seed());
while ($count < 10000)
{
$randomize = $randomize + mt_rand(1,10);
$count = $count + 1;
}
print $randomize;
print("<br>");
while ($count < 10000)
{
$randomize = $randomize + mt_rand(1,10);
$count = $count + 1;
}
print $randomize;
print("<br>");
while ($count < 10000)
{
$randomize = $randomize + mt_rand(1,10);
$count = $count + 1;
}
print $randomize;
?>
check een werkend voorbeeld op http://www.needforgaming.com/test.php
Waarom doet ie NIKS bij de 2e en 3e loop?
Ik wil dat ie weer nieuwe randomwaardes gaat maken.. maar hoe doe ik dat?