-
Notifications
You must be signed in to change notification settings - Fork 57
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
Pine C16 Eunice & Lilly #30
base: master
Are you sure you want to change the base?
Conversation
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 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(): |
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 work!
tile_bag.remove(letter) | ||
|
||
return tile_list | ||
|
||
|
||
def uses_available_letters(word, 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 work, this is a clever way to solve this.
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"] |
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 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+=10 | ||
if len(modified_word)>=7: | ||
total+=8 | ||
return(total) | ||
|
||
def get_highest_word_score(word_list): |
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.
Clever use of max and min to determine the winner.
No description provided.