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

Benjamin Mako Hill || Want to submit a patch?