Skip to content

Qiaoqiao Tan C23 Snowman Feedback#32

Open
mikellewade wants to merge 3 commits intoAda-C23:mainfrom
Shirley425:main
Open

Qiaoqiao Tan C23 Snowman Feedback#32
mikellewade wants to merge 3 commits intoAda-C23:mainfrom
Shirley425:main

Conversation

@mikellewade
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Author

@mikellewade mikellewade left a comment

Choose a reason for hiding this comment

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

Nice work, Qiaoqiao! I left a comment about your implementation missing one of the requirements for the function. Please be sure to respond to the comment. If you have any questions about the feedback I left let me know!

'Sorry, you lose! The word was {snowman_word}' if the player loses
"""
pass
wrong_guesses_count = 0
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Do we necessarily need to keep count of the wrong guesses? How could we get this same information from the list of wrong guesses that we have?

wrong_guesses_list = []
correct_letter_guess_statuses = build_letter_status_dict(snowman_word)

while wrong_guesses_count < SNOWMAN_MAX_WRONG_GUESSES:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Nice work with this while loop! We don't actually know how many times it will take a user to guess the word or hit the limit of wrong guesses (could keep make invalid guesses) so this the perfect choice for that situation!


letter_guess = get_letter_from_user(correct_letter_guess_statuses, wrong_guesses_list)

if letter_guess in snowman_word:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Another way that this could be done is by checking the dictionary that was constructed with build_letter_status_dict. There are some advantages here that we've not talked about yet but it doesn't hurt to think through how it could be done!

Comment on lines +34 to +36
for letter in snowman_word:
if letter == letter_guess:
correct_letter_guess_statuses[letter] = True
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Do we actually need to preform this logic? Since if letter_guess in snowman_word determines if the guess was inside of our snowman_word then couldn't we also just do this instead?

correct_letter_guess_statuses[letter_guess] = True

correct_letter_guess_statuses[letter] = True
if is_word_guessed(snowman_word, correct_letter_guess_statuses):
print("Congratulations, you win!")
return
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Nice use of the return keyword. This allows for us to exit not only the while loop early if this condition is met but also the function as a whole.

if is_word_guessed(snowman_word, correct_letter_guess_statuses):
print("Congratulations, you win!")
return
else:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Your code is missing an implementation of one of the requirements. Your snowman function should display the list of incorrect guesses. @Shirley425 please respond to this comment with how you would implement this feature.

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.

2 participants