Skip to content

Conversation

@rose-codes
Copy link

No description provided.

Copy link

@spitsfire spitsfire left a 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):

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!

Comment on lines +72 to +73
count = hand_of_ten_letters.count(random_letter)
if count < LETTER_POOL[random_letter]:

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!

Comment on lines +81 to +82
if word.count(char) is not hand_of_ten_letters.count(char):
return False

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?

return False
return True

def score_word(word):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +111 to +112
highest_score_tuple = highest_scoring_word,highest_score
return(highest_score_tuple)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants