[ create a new paste ] login | about

Link: http://codepad.org/g52JwcQw    [ raw code | output | fork ]

pauld - PHP, pasted on Jul 16:
1
<?php $a=4;$b=3;$c=-1;$d=$a*$b;$e=$a;$f=($b-1);function c($g,$k){global $c,$d;for($l=0;$l<$g;$c=$c+$k,++$l,--$d,print $c.' ');}while($d>0){$m=1;$g=$e;c($g,$m);--$e;if($f>0){$m=$a;$g=$f;c($g,$m);--$f;if($e>0){$m=-1;$g=$e;c($g,$m);--$e;if($f>0){$m=-$a;$g=$f;c($g,$m);--$f;}}}}?>


Output:
1
0 1 2 3 7 11 10 9 8 4 5 6 


Create a new paste based on this one


Comments: