Skip to content

Instantly share code, notes, and snippets.

@KirarinSnow
Forked from yosun/spiralgolf.py
Last active August 29, 2015 14:15
Show Gist options
  • Save KirarinSnow/a2abcbfeda046a62b29d to your computer and use it in GitHub Desktop.
Save KirarinSnow/a2abcbfeda046a62b29d to your computer and use it in GitHub Desktop.
87 chars!!! (95 for size read in through stdin)
i=-1
exec"j=0;i%s;"%(",;j+=1;print'x '[(j,i)[(31-j>i)^(i>j)]+(i-1==j<15)&1]"*31)[3:]*31
i,n=-1,input()
exec"j=0;i%s;"%(",;j+=1;print'x '[(j,i)[(n-j>i)^(i>j)]+(i-1==j<n/2)&1]"*n)[3:]*n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment