Skip to main content
2 of 4
added 178 characters in body
Timwi
  • 13k
  • 3
  • 46
  • 66

Perl, 112 characters

$p=144;$d+=($f[$p]^=2)+1,$p+=(1,-17,-1,17)[$d%=4]for 1..<>;$f[$p]=1;print$_%17?'':$/,qw(_ @ #)[$f[$_]]for 0..288 

Number is read from the first line of STDIN. Rest of input is ignored.

Slightly more readable:

$p=144; $d+=($f[$p]^=2)+1, $p+=(1,-17,-1,17)[$d%=4] for 1..<>; $f[$p]=1; print $_%17 ? '' : $/, qw(_ @ #)[$f[$_]] for 0..288 
Timwi
  • 13k
  • 3
  • 46
  • 66