Skip to content

Instantly share code, notes, and snippets.

@stevenewey
Created May 4, 2012 09:19
Show Gist options
  • Save stevenewey/2593537 to your computer and use it in GitHub Desktop.
Save stevenewey/2593537 to your computer and use it in GitHub Desktop.
May ldnpydojo team 1 effort
import sys
raw = [
[' _ ',
'| |',
'|_|' ],
[' ',
' |',
' |' ],
[' _ ',
' _|',
'|_ ' ],
[' _ ',
' _|',
' _|' ],
[' ',
'|_|',
' |' ],
[' _ ',
'|_ ',
' _|' ],
[' _ ',
'|_ ',
'|_|' ],
[' _ ',
' |',
' |' ],
[' _ ',
'|_|',
'|_|' ],
[' _ ',
'|_|',
' _|' ],
]
l = [""]*3
with open(sys.argv[1]) as f:
try:
while True:
for i in range(3):
l[i] = f.next().rstrip('\n')
if len(l[0]) < len(l[1]):
l[0] = l[0] + ' '*(len(l[1])-len(l[0]))
grid = [""]*3
while len(l[1]) > 2:
for i in range(3):
grid[i] = l[i][:3]
l[i] = l[i][3:]
print raw.index(grid),
print
f.next()
except StopIteration:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment