Langtons Ant by inaniwa(cheat)

s[9999];p;w;d;main(n,r){w="\x0b\x12/"[r%=3u]-scanf("%d",&n);for(p=L"#\xC5\x54D"[r];n+s;p+=d%2?(d%4-2)*w:d%4-1)n-->0?(s[p]^=3)?d++:d--:putchar(n%w?s[-n]+32:10);}

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

download

return to the top page