Skip to content
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

Whales - Alexa Coffman and Uyen Vong #36

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

AlexaCoffman
Copy link

No description provided.

Copy link

@goeunpark goeunpark left a comment

Choose a reason for hiding this comment

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

Wonderful work, Alexa and Uyen! 🚀

Your tests pass, your logic is superb, and I can wax poetic about your spiffy update_best_word function all day long. Y'all have made great choices regarding your data types and your code is exceptionally clean and efficient. This project is a Green. 🟢

Let me know if you have any questions on the feedback. Keep it up!

Comment on lines +42 to +44
while len(drawn_letters) < 10:
rand_index = randint(0, len(letter_pool_copy)-1)
drawn_letters.append(letter_pool_copy.pop(rand_index))

Choose a reason for hiding this comment

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

Interesting way to randomly pick a letter! I also love that you modeled your LETTER_POOL list to contain the correct frequency of letters in a bag. Great work!

Choose a reason for hiding this comment

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

But also...what if the instructors were feeling ~ chaotic ~ and said there were 100,000 tiles in the pool in total? Could you have programmatically made the LETTER_POOL list? (I'm sure you could have!)

# create a copy of letter bank so we don't alter original list
letter_bank_copy = deepcopy(letter_bank)
word = word.upper()
valid_word = True

Choose a reason for hiding this comment

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

This is soooo pythonic! 🐍 I adore how y'all set a boolean for valid_word at the top of the function and reassign on L56 depending on the condition, then return this boolean only once in L60! While the following is acceptable:

if [valid conditional]:
    return True
else:
    return False

What y'all did (set a boolean variable to have only one return statement at the end of the function, like below) is a Pythonista's dream! Great work!

valid = True
if [not valid conditional]:
    valid = False
return valid

Comment on lines +77 to +78
if word == None:
return None

Choose a reason for hiding this comment

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

Great validation check!

Comment on lines +89 to +92
"word" : "",
"score" : 0
}

Choose a reason for hiding this comment

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

Love the organization of best word and score as a dictionary! 🤩

Comment on lines +107 to +109
best_word["score"] = score
best_word["word"] = word

Choose a reason for hiding this comment

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

Lovely helper function! 💯

best_word["score"] = score
best_word["word"] = word
return best_word

Choose a reason for hiding this comment

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

Python (and most languages, if I think of it) likes it when you have a newline at the end of the file. (Why? Because it's one of those Just Unix/Computer Things, I guess?)

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