Funge spiral by jonathan camacho

@dc=([1,0],[0,-1],[-1,0],[0,1]);
@cc=split(//, "<v>^");

@b=("-"x 30)x 30;
substr($b[15],14,1,"@");
$x=14;$y=15;$d_i=3;$c_i=3;
$L=1;
for(1..59){
  $d_i++;$c_i++;
  for(1..$L){
    $x+=$dc[$d_i%4][0];
    $y+=$dc[$d_i%4][1];
    substr($b[$y],$x,1,$cc[$c_i%4]);
  }
  $L++if$_%2==0;
}
substr($b[0],29,1,"v");
print(join("\n", @b));

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page