Skip to content

Renata Murzina C23 Snowman Feedback#33

Open
mikellewade wants to merge 1 commit intoAda-C23:mainfrom
RenaSpb:main
Open

Renata Murzina C23 Snowman Feedback#33
mikellewade wants to merge 1 commit intoAda-C23:mainfrom
RenaSpb: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.

Renata, great work! Your code organized well and you made some great design decisions! If you have any questions about the comments I left please feel free to reach out!

Comment thread game.py
Comment on lines +23 to +26
# random_word_generator = RandomWord()
# snowman_word = random_word_generator.word(
# word_min_length=SNOWMAN_MIN_WORD_LENGTH,
# word_max_length=SNOWMAN_MAX_WORD_LENGTH)
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.

Don't forget you want to delete comments like these. We usually only want to leave comments when the information is vital. However, I think these are safe to remove given that they are just variables.

Comment thread game.py
correct_letter_guess_statuses = build_letter_status_dict(snowman_word)
wrong_guesses_list = []

while len(wrong_guesses_list) < 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!

Also, I love how you used the provided len function to get access to the number of wrong guesses a player has made.

Comment thread game.py
while len(wrong_guesses_list) < SNOWMAN_MAX_WRONG_GUESSES:
user_input = get_letter_from_user(correct_letter_guess_statuses, wrong_guesses_list)

if user_input in correct_letter_guess_statuses:
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.

Love this! In the near future you will see how searching for a key in a dictionary has a considerable advantage over searching for an element in a list (Time Complexity if you you are interested!)

Comment thread game.py
Comment on lines +38 to +39
print(f"The letter {user_input} is not in the word")
wrong_guesses_list.append(user_input)
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.

⭐️

Comment thread game.py

print_snowman_graphic(len(wrong_guesses_list))
print_word_progress_string(snowman_word, correct_letter_guess_statuses)
print(f"Wrong guesses: {', '.join(wrong_guesses_list)}")
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 string interpolation here! This results in a cleaner user experience!

Comment thread game.py

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.

Comment thread game.py
Comment on lines +49 to +50
print(f'Sorry, you lose! The word was {snowman_word}')
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.

With this indentation level this will only run if the user exceeds the max number of wrong guess, great work!

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