d183cd2fbfbfb176f104214431a197cd6f95a73e
[wordplay-cdsw-solutions] / solution_8.py
1 import scrabble
2
3
4 # See if you can tell the difference between this solution and the broken solution.
5
6
7
8 max_score = 0
9 max_word = ''
10 for word in scrabble.wordlist:
11     if len(word) <= 7 and len(word) >= 5 and word[0] == 'a' and word[3] == 'e':
12         score = 0
13         for char in word:
14             score = score + scrabble.scores[char]
15         if score > max_score:
16             max_word = word
17             max_score = score
18
19 print max_score
20 print max_word
21
22

Benjamin Mako Hill || Want to submit a patch?