Conversation
| wrong_guesses_list = [] | ||
| wrong_guesses_count = 0 | ||
|
|
||
| while wrong_guesses_count < SNOWMAN_MAX_WRONG_GUESSES: |
There was a problem hiding this comment.
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!
|
|
||
| if is_word_guessed(snowman_word, correct_letter_guess_statuses): | ||
| print("Congratulations, you win!") | ||
| return |
There was a problem hiding this comment.
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.
|
|
||
| guess = get_letter_from_user(correct_letter_guess_statuses, wrong_guesses_list) | ||
|
|
||
| if guess in snowman_word: |
There was a problem hiding this comment.
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!
| correct_letter_guess_statuses[guess] = True | ||
| else: | ||
| wrong_guesses_list.append(guess) | ||
| wrong_guesses_count += 1 |
There was a problem hiding this comment.
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.append(guess) | ||
| wrong_guesses_count += 1 | ||
| print_snowman_graphic(wrong_guesses_count) | ||
| print(f"Wrong guesses so far: {wrong_guesses_list}") |
There was a problem hiding this comment.
For a better user experience, how could we alter this print statement so that the [] aren't wrapped around the guesses of a player?
No description provided.