Dragon curve by hallvabo

d=2**input()+1
x=411718%(d+752)
W=-89139139%x
g=(~-W*[' ']+['\n'])*53
for n in range(d):g[x]='*';d+=cmp((n&-n)*2&n,1);x+=(1,W,-1,-W)[d%4]
print''.join(g)

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

download

return to the top page