Word wheel: Difference between revisions

Content added Content deleted
m (C - removed inline keyword)
m (→‎{{header|Python}}: Added an experimental pre-test. Barely worth it, but left it it anyway :-)
Line 588:
cs = ''.join(grid).lower()
wheel = sorted(cs)
wset = set(wheel)
mid = cs[4]
return [
w for w in ws
if 2 < len(w) and (mid in w) and (
wheelFit(wheel)all(c in wset for c in w)
) and wheelFit(wheel, w)
]
return go
Line 599 ⟶ 600:
 
# wheelFit :: String -> String -> Bool
def wheelFit(wheel, word):
'''True if a given word can be constructed
from (single uses of) some subset of
Line 612 ⟶ 613:
)
)
return lambda word: go(wheel, sorted(word))
 
 
Line 619 ⟶ 620:
def main():
'''Word wheel matches for a given grid in a copy of
http://wiki.puzzlers.org/pub/wordlists/unixdict.txt
'''
print('\n'.join(