projects
/
wordplay-cdsw-solutions
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Whitespace corrections, a couple bug fixes, replacing a format string with constructi...
[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
for word in scrabble.wordlist:
8
if word[0] == 'a' and word[3] == 'e' and len(word) <= 7 and len(word) >= 4:
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?