]> projects.mako.cc - wordplay-cdsw-solutions/blob - solution_8_broken.py
06beb89b378e8c5c487964b19f34ec1dc5616435
[wordplay-cdsw-solutions] / solution_8_broken.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 word[0] == 'a' and word[3] == 'e' and len(word) <= 7 and len(word) >= 4:
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?