-
Notifications
You must be signed in to change notification settings - Fork 135
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
Kunzite - Abby Castillo #126
base: main
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.
Good job overall! I left a few comments inline for you to review.
|
||
def score_word(word): | ||
pass | ||
score = 0 |
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 job here, this will score the word according to the letter to point value mapping, however the requirements for Wave 03 also state: "If the length of the word is 7, 8, 9, or 10, then the word gets an additional 8 points", which this function doesn't account for.
|
||
import random | ||
|
||
LETTERS_TUPLE = ( {'A': 9, |
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.
Interesting choice of data structure! Since in the next line of you index this nested dictionary out of the tuple, it's not clear why the nesting in the first place - you could use a dictionary and bypass the need to index a tuple!
|
||
# helper functions | ||
|
||
def make_letter_pool_list(letter_frequencies): |
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.
Cool helper function, this will help ensure the letter pool distribution is accounted for!
|
||
def uses_available_letters(word, letter_bank): | ||
pass | ||
hand = list(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.
letter_bank
is already a list, so no need to convert to a list.
if letter not in hand: | ||
return False | ||
elif letter in hand: | ||
hand.remove(letter) |
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.
No need to remove the letter from the hand on this implementation. All you're concerned with is checking whether the letter is not in the hand. If you iterate over all the letters and find that all of them are in the hand, you can just return True
.
No description provided.