5 ms·
we will probably continue to program the problem solvers for some time to come. $code = '$z = 0;' . PHP_EOL . '$y = 0;' . PHP_EOL
by k8tte 11y ago
we will probably continue to program the problem solvers for some time to come.
$code = '$z = 0;' . PHP_EOL
. '$y = 0;' . PHP_EOL
. '$x = 0;' . PHP_EOL
. '$x = 0;' . PHP_EOL
. '$y = 1;' . PHP_EOL
. 'for ($count = 0; $count < 10; $count++) {' . PHP_EOL
. ' $z = $x + $y;' . PHP_EOL
. ' echo $z;' . PHP_EOL
. ' $x = $y;' . PHP_EOL
. ' $y = $z;' . PHP_EOL
. '}';
$this->assertPhpAndResultEquals(
$code,
'123581321345589',
$this->asPhp(
'sätt x till 0 och sätt y till 1 och upprepa följande 10 gånger:'
. ' sätt z till x + y'
. ' och visa z'
. ' och sätt x till y'
. ' och sätt y till z'
)
);