C17 - Otters - Doina and Taingleap #47
Open
taingleapchheang wants to merge 3 commits intoada-c17:masterfrom
Open
C17 - Otters - Doina and Taingleap #47taingleapchheang wants to merge 3 commits intoada-c17:masterfrom
taingleapchheang wants to merge 3 commits intoada-c17:masterfrom
Conversation
kaidamasaki
reviewed
Apr 5, 2022
kaidamasaki
left a comment
There was a problem hiding this comment.
Great job!
Your code is clear and easy to read, well done!
Comment on lines
+40
to
+41
| # shuffle the list | ||
| random.shuffle(letter_list) |
Comment on lines
+60
to
+61
| SCORE_CHART = {'A': 1,'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, | ||
| 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10} |
There was a problem hiding this comment.
Style: It's good practice to put global constants like this up near the top of the file (under the imports).
Comment on lines
+66
to
+68
| for letter in word.upper(): | ||
| if letter in SCORE_CHART: | ||
| score += SCORE_CHART[letter] |
There was a problem hiding this comment.
You can make this slightly cleaner by using get:
Suggested change
| for letter in word.upper(): | |
| if letter in SCORE_CHART: | |
| score += SCORE_CHART[letter] | |
| for letter in word.upper(): | |
| score += SCORE_CHART.get(letter, 0) |
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.