Skip to content

Instantly share code, notes, and snippets.

/seven.py Secret

Created June 9, 2015 01:40
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 anonymous/fecf4c4f5fcf4f402617 to your computer and use it in GitHub Desktop.
Save anonymous/fecf4c4f5fcf4f402617 to your computer and use it in GitHub Desktop.
def f(s):
r=['1111101','0101000','0110111','0101111','1101010','1001111','1011111','0101100','1111111','1101111'];n=len(s)*2;l=[[' ']*(n+1)for x in xrange(n+1)];shifts=[(0,1,'\\'),(1,0,'\\'),(1,2,'\\'),(2,1,'\\'),(0,0,'/'),(1,1,'/'),(2,2,'/')]
for x in xrange(0,n,2):
y=n-2-x
for i,[dx,dy,c] in enumerate(shifts):
l[y+dy][x+dx]=[' ',c][r[map(int,s)[x/2]][i]=='1']
print'\n'.join(''.join(x)for x in l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment