Skip to content

Snowman Feedback - Jesica Guallpa#4

Open
yangashley wants to merge 1 commit intoAda-C24:mainfrom
jguall421:main
Open

Snowman Feedback - Jesica Guallpa#4
yangashley wants to merge 1 commit intoAda-C24:mainfrom
jguall421:main

Conversation

@yangashley
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Collaborator Author

@yangashley yangashley left a comment

Choose a reason for hiding this comment

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

Nice job! Please review my comments, and let me know if you have any questions.

Comment thread game.py

if is_word_guessed(snowman_word,correct_letter_guess_statuses):
print_word_progress_string(snowman_word, correct_letter_guess_statuses)
print("Congratsm you win!")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Typo

Suggested change
print("Congratsm you win!")
print("Congrats you win!")

Comment thread game.py

while len(wrong_guesses_list) < SNOWMAN_MAX_WRONG_GUESSES:
print_word_progress_string(snowman_word, correct_letter_guess_statuses)
print("Wrong guesses so far:", wrong_guesses_list)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👍 Nice job showing the player their incorrect guesses

Comment thread game.py
while len(wrong_guesses_list) < SNOWMAN_MAX_WRONG_GUESSES:
print_word_progress_string(snowman_word, correct_letter_guess_statuses)
print("Wrong guesses so far:", wrong_guesses_list)
print_snowman_graphic(len(wrong_guesses_list))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👍 Nice job using finding the length of wrong_guesses_list and passing that value to print_snowman_graphic. Doing so means you don't need to create an unnecessary variable like wrong_guesses_count that would need to be manually incremented (which would be a place that a bug could get introduced).

Comment thread game.py
if user_guess in correct_letter_guess_statuses:
correct_letter_guess_statuses[user_guess] = True
print(f"Good Job! '{user_guess}' is in the word. \n ")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'd argue you don't need this blank line on line 34 because we don't need it to visually/logically separate the code on lines 31-33 and lines 35-37.

Suggested change

Avoid adding unnecessary blank lines to your project because it makes your codebase longer and doesn't comply with the PEP8 style guide.

The guide says "Surround top-level function and class definitions with two blank lines." and "Extra blank lines may be used (sparingly) to separate groups of related functions."

Review the style guide recommendations on blank lines here.

Comment thread game.py
if is_word_guessed(snowman_word,correct_letter_guess_statuses):
print_word_progress_string(snowman_word, correct_letter_guess_statuses)
print("Congratsm you win!")
return
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

A return statement in Python stops the execution of code. I'm wondering if you can think of another way the logic could be written so that you can end the game without needing to use return (or a break statement) to break the loop?

This isn't a requirement, but if you'd like more practice with writing conditional logic in Python, I'd suggest thinking through and re-writing the logic so you don't need return to stop the game.

If you choose to do so, there's no need for you to submit anything to me for re-review. This would just be for your own practice 😊

Comment thread game.py
Comment on lines +45 to +46


Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change

Remove unnecessary blank lines from the function and don't forget to remove the pass keyword (line 47) from a function when you're done writing the implementation. "The pass statement is used as a placeholder for future code. When the pass statement is executed, nothing happens, but you avoid getting an error when empty code is not allowed. Empty code is not allowed in loops, function definitions, class definitions, or in if statements."

Read more about pass here.

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