Open
Conversation
CheezItMan
reviewed
Sep 28, 2021
Collaborator
CheezItMan
left a comment
There was a problem hiding this comment.
Nice work. All the functions worked and, you hit the learning goals here. I had a few comments to make the code a bit more streamlined, but it all works. Well done.
| @@ -1,11 +1,93 @@ | |||
| import random | |||
| def draw_letters(): | |||
| return tile_list | ||
|
|
||
|
|
||
| def uses_available_letters(word, letter_bank): |
Collaborator
There was a problem hiding this comment.
👍 Nice work, this is a clever way to solve this.
Comment on lines
+35
to
+41
| value1=["A","E","I","O","U","L","N", "R", "S", "T"] | ||
| value_2=["D", "G"] | ||
| value_3=["B", "C", "M", "P"] | ||
| value_4=["F", "H", "V", "W", "Y"] | ||
| value_5=["K"] | ||
| value_8=["J", "X"] | ||
| value_10=["Q", "Z"] |
Collaborator
There was a problem hiding this comment.
This works, but It involves a lot of hardcoded if statements. This could also be solved with a dictionary, using either a set of letters as values and scores as values, or individual letters as keys and points as values.
For example
letter_scores = {
{"A","E","I","O","U","L","N", "R", "S", "T"}: 1,
{"D", "G"}: 2,
...Or:
letter_scores = {
'A': 1,
'B': 3,
'C': 3,
...Then you can solve the problem with a more compact loop.
| total+=8 | ||
| return(total) | ||
|
|
||
| def get_highest_word_score(word_list): |
Collaborator
There was a problem hiding this comment.
Clever use of max and min to determine the winner.
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.