Skip to content

Instantly share code, notes, and snippets.

@erkyrath
Created May 13, 2014 15:58
Show Gist options
  • Save erkyrath/c7bfa4a957abbde41561 to your computer and use it in GitHub Desktop.
Save erkyrath/c7bfa4a957abbde41561 to your computer and use it in GitHub Desktop.
Quick hack to look for Fiasco strategies
import sys
ls = []
while True:
ln = sys.stdin.readline()
if not ln:
break
ls.append(ln.strip().lower())
print len(ls)
map = {}
for pos in range(8):
for wd in ls:
temp = wd[:pos] + '-' + wd[pos+1:]
if temp not in map:
map[temp] = []
map[temp].append(wd)
temps = map.keys()
temps.sort(key = lambda temp: -len(map[temp]))
for temp in temps[:20]:
print map[temp]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment