|
|
|
|
|
by ttttannebaum
5296 days ago
|
|
Looking at your Python script. Might want to learn about the built-in set() functionality. For exmaple: def uniqueletters(s): return set(c for c in s) def intersect(word, charlist): return len(uniqueletters(word).intersection(charlist)) |
|
max(wordlist, key=(lambda w: intersect(w, charlist))
should replace a good portion of the create_mnemonic function. But now I'm just showing off. Just letting you know that Python is much cooler than you know.
Haskell, however, could probably do this in a few lines.