-
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
Maple - Faith and Kristina #48
base: master
Are you sure you want to change the base?
Conversation
getting Faith's changes
''' | ||
# use a dictionary with the letter as the key and the number of instances/tiles as the value | ||
# make a copy of LETTER_POOL (shallow/deep) | ||
all_letters = LETTER_POOL.copy() |
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.
making a copy is a great approach and helps prevent side effects with the LETTER_POOL
# initialize an empty array to hold strings (letters) | ||
drawn_letters = [] | ||
# continue loop until the list has ten values | ||
while len(drawn_letters) < 10: |
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.
a while loop is another great approach!
one_point = ['A','E','I','O', 'U', 'L', 'N','R','S','T'] | ||
two_point = ['D','G'] | ||
three_point = ['B','C','M','P'] | ||
four_point = ['F','H','V','W','Y'] | ||
five_point = ['K'] | ||
eight_point = ['J','X'] | ||
ten_point = ['Q', 'Z'] | ||
# create variable word_score and start at 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.
another approach to this would be to create key, value pairs in a dictionary. Then you could use the sum method to find the score and then use lines 78-79 that you already have to find the score of the word.
word_score += 10 | ||
return word_score | ||
|
||
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.
great work
else: | ||
return False | ||
return True | ||
|
||
|
||
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.
great use of max and min methods!
Overall great work! I liked seeing how you all approached each function. I left a few comments on the refactoring part of your code. |
No description provided.