Open
Conversation
and highest_score strings are stored so that the tuple is not inside a nested dictionary"
kaidamasaki
reviewed
Sep 30, 2021
Collaborator
kaidamasaki
left a comment
There was a problem hiding this comment.
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 |
Collaborator
There was a problem hiding this comment.
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) |
Collaborator
There was a problem hiding this comment.
Style: spacing
Suggested change
| tup = tuple(letter*frequency) | |
| tup = tuple(letter * frequency) |
|
|
||
| def uses_available_letters(word, letter_bank): | ||
| pass | ||
| compare_letters = copy.deepcopy(letter_bank) |
Collaborator
There was a problem hiding this comment.
Nice use of deepcopy. 😃
Comment on lines
+95
to
+104
| 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 |
Collaborator
There was a problem hiding this comment.
You can simplify this by reordering things a little:
Suggested change
| 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.)
Comment on lines
+116
to
+117
| highest_score_word = "" | ||
| hst_score_and_word = "" |
Collaborator
There was a problem hiding this comment.
I recommend initializing placeholders like this to None for clarity:
Suggested change
| highest_score_word = "" | |
| hst_score_and_word = "" | |
| highest_score_word = None | |
| hst_score_and_word = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.