Skip to content

Tigers - Rose and Kindra#63

Open
rose-codes wants to merge 13 commits intoAda-C18:masterfrom
rose-codes:master
Open

Tigers - Rose and Kindra#63
rose-codes wants to merge 13 commits intoAda-C18:masterfrom
rose-codes:master

Conversation

@rose-codes
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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!

Comment thread adagrams/game.py
'Z': 10
}

def create_letter_pool_list(LETTER_POOL):
Copy link
Copy Markdown

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 thread adagrams/game.py
Comment on lines +72 to +73
count = hand_of_ten_letters.count(random_letter)
if count < LETTER_POOL[random_letter]:
Copy link
Copy Markdown

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 thread adagrams/game.py
Comment on lines +81 to +82
if word.count(char) is not hand_of_ten_letters.count(char):
return False
Copy link
Copy Markdown

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?

Comment thread adagrams/game.py
return False
return True

def score_word(word):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Comment thread adagrams/game.py
Comment on lines +111 to +112
highest_score_tuple = highest_scoring_word,highest_score
return(highest_score_tuple)
Copy link
Copy Markdown

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