-
Notifications
You must be signed in to change notification settings - Fork 57
Cedar - Citlalli Z #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
and highest_score strings are stored so that the tuple is not inside a nested dictionary"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
I left a few small comments but everything looks good!
|
||
Use `ls` to confirm there's a new project folder | ||
|
||
Use `ls` to confil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why it's good to git diff
before you commit things. :-P
tup = "" | ||
|
||
for letter, frequency in LETTER_POOL.items(): | ||
tup = tuple(letter*frequency) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: spacing
tup = tuple(letter*frequency) | |
tup = tuple(letter * frequency) |
|
||
def uses_available_letters(word, letter_bank): | ||
pass | ||
compare_letters = copy.deepcopy(letter_bank) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of deepcopy
. 😃
if word == "": | ||
return 0 | ||
else: | ||
for letter in word: | ||
score_list.append(LETTER_VALUE[letter.upper()]) | ||
if len(score_list) >= 7: | ||
score = (sum(score_list) + bonus) | ||
else: | ||
score = sum(score_list) | ||
return score |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify this by reordering things a little:
if word == "": | |
return 0 | |
else: | |
for letter in word: | |
score_list.append(LETTER_VALUE[letter.upper()]) | |
if len(score_list) >= 7: | |
score = (sum(score_list) + bonus) | |
else: | |
score = sum(score_list) | |
return score | |
score = 0 | |
for letter in word: | |
score_list.append(LETTER_VALUE[letter.upper()]) | |
if len(score_list) >= 7: | |
score = (sum(score_list) + bonus) | |
else: | |
score = sum(score_list) | |
return score |
(This works because if the loop never runs score
stays at 0
.)
highest_score_word = "" | ||
hst_score_and_word = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend initializing placeholders like this to None
for clarity:
highest_score_word = "" | |
hst_score_and_word = "" | |
highest_score_word = None | |
hst_score_and_word = None |
No description provided.