Skip to content

Instantly share code, notes, and snippets.

@leehosung
Created August 24, 2018 13:47
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/43e41b80ead94c000f4a9912b059d436 to your computer and use it in GitHub Desktop.
Save leehosung/43e41b80ead94c000f4a9912b059d436 to your computer and use it in GitHub Desktop.
PyCon Korea 2017 Code Golf 2
count = int(input())
sizes = [int(input()) for _ in range(count)]
map = []
a=max(sizes)
for i in range(a):
map.append([' ']*a)
for n in sizes:
x = int(a / 2) - int(n / 2)
m = int(n/2)
for i in range(m+1):
map[m+i+x][i+x] = '*'
map[m-i+x][i+x] = '*'
map[m+i+x][n-i-1+x] = '*'
map[m-i+x][n-i-1+x] = '*'
for line in map:
print(''.join(line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment