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