Skip to content

Instantly share code, notes, and snippets.

/seven.py Secret

Created Jun 9, 2015
Embed
What would you like to do?
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