$steps = 50;
$number = 300;
for ($i = 0 ;$i <= $steps; $i++){
if ($number <= 0)
$newNumber = $number + rand(0,100);
else
$newNumber = $number - rand(0,100);
echo $i . " = " . $newNumber . "\r\n";
}
?>
0
300
0 = 234
234
300
1 = 277
277
300
$steps = 50;
$newNumber = 300;
for ($i = 0 ;$i <= $steps; $i++){
echo $newNumber . "\r\n";
if ( $newNumber <= 0 )
$newNumber = $newNumber + rand(0,100);
else
$newNumber = $newNumber - rand(0,100);
echo $i . " = " . $newNumber . "\r\n";
}
?>