projects
/
wordplay-cdsw-solutions
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add a license.
[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?