Skip to content

Instantly share code, notes, and snippets.

@leehosung
Created August 24, 2018 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leehosung/54fba9ee8fcdad4e7a744b05ea4efd33 to your computer and use it in GitHub Desktop.
Save leehosung/54fba9ee8fcdad4e7a744b05ea4efd33 to your computer and use it in GitHub Desktop.
PyCon Korea 2017 Code Golf2
r,t,c=range,'*',int(input())
s=[int(input()) for _ in r(c)]
a=max(s)
m=[[' ']*a for j in r(a)]
for n in s:
x=a//2-n//2
b=n//2
for i in r(b+1):z=i+x;u=x-i;m[b+z][z]=t;m[b+u][z]=t;m[b+z][n-1+u]=t;m[b+u][n-1+u]=t
for l in m:print(''.join(l))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment