Skip to content

Instantly share code, notes, and snippets.

View DeadWisdom's full-sized avatar

Brantley Harris DeadWisdom

View GitHub Profile
@DeadWisdom
DeadWisdom / scrabble.py
Created December 7, 2011 10:07
Scrabble.py
def scrabble(dictionary_path, letters, max=10):
results = []
letters = set(letters)
for word in open(dictionary_path):
word = word.strip()
if letters == set(word):
results.append(word)
results.sort(key=len)
results.reverse()
return results[:max]