-
Notifications
You must be signed in to change notification settings - Fork 89
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
Tigers - Rose and Kindra #63
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.
Nicely done working together, Rose and Kindra! Your code was easy to read and understand! If you have any questions about the feedback given, reach out to me!
'Z': 10 | ||
} | ||
|
||
def create_letter_pool_list(LETTER_POOL): |
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.
Love a good helper function!! 👍 By creating a list of all letters by quantity, we get a more accurate hand of letter from the pool!
count = hand_of_ten_letters.count(random_letter) | ||
if count < LETTER_POOL[random_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.
Since the letter_pool_list
has all the letters that can be pulled inside it, instead of finding the count of the letter every time, what if we just used remove
and took out the letter from the list.
Now, the next time line 71 executes, it will have an accurate pool of letters that never need recounting. If it's in the list still, then it's fair game.
Either works! I don't think my suggestion is any more efficient than yours, however!
if word.count(char) is not hand_of_ten_letters.count(char): | ||
return False |
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! While the tests all passed, I think we can expand on the logic here to make it more robust. Let's say our word is "DOG" and our hand is [D,G,G,I,O,D,L,A,S,T]
Would your function return this as true or false?
for char in word: | ||
if word.count(char) is not hand_of_ten_letters.count(char): | ||
return False | ||
return True | ||
|
||
def score_word(word): |
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.
👍
return(highest_score_tuple) |
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.
We could combine these together in one line:
return highest_scoring_word,highest_score
No description provided.