Yes it's about loops. I have the below script and the first loop there is no problem as it mixes the variables but on the second loop I can't seem to figure out how to find the value of $c. Does anybody know because this is an annoying puzzle I have been trying to figure out. I got everything else correct except for finding the value of $c in the second loop. Please help.
<?php
$a=1;
$b=47;
$c=88;
$tmp=23;
for($i=0;$i<80;$i++) {
$random_number=floor(mt_rand(0,1000));
echo $random_number.'<br>';
$tmp=($tmp+$c+$random_number)*0.5;
$c=$b;
$b=$a;
$a=$tmp;
}
//Now to reverse
echo '<hr>';
$tmp=$a;
for ($i=0;$i<80;$i--) {
$a=$b;
$b=$c;
//$c=(unknown);
//$random_number=(($tmp-$c)-$a)*2;
//$tmp=($tmp-(($random_number*0.5)+$c+$a))*2;
//echo $random_number.'<br>';
}
?>