projects
/
wordplay-cdsw-solutions
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
75aaa5e2e9cca63c7d901e62e97cfa34690391a2
[wordplay-cdsw-solutions]
/
solution_8.py
1
import scrabble
2
3
# See if you can tell the difference between this solution and the broken solution.
4
5
max_score = 0
6
max_word = ''
7
for word in scrabble.wordlist:
8
if len(word) <= 7 and len(word) >= 4 and word[0] == 'a' and word[3] == 'e':
9
score = 0
10
for char in word:
11
score = score + scrabble.scores[char]
12
if score > max_score:
13
max_word = word
14
max_score = score
15
16
print max_score
17
print max_word
Benjamin Mako Hill
||
Want to submit a patch?