Word wheel: Difference between revisions

Line 219:
 
def getwords(url='http://wiki.puzzlers.org/pub/wordlists/unixdict.txt'):
"Return sorted lowercased words of 3 to 9 characters"
words = urllib.request.urlopen(url).read().decode().strip().lower().split()
return sorted(set(w for w in words if 2 < len(w) < 10))
 
def solve(grid, dictionary):
gridcount = Counter(grid)
mid = grid[4]
return [sorted(word for word in dictionary
if mid in word and not (Counter(word) - gridcount)])
 
 
Anonymous user