Skip to content

Conversation

@DelDaria
Copy link
Owner

What

  • module project

Why

  • for final task

game.py Outdated
print("You were hit!")
print('{} dies! Score is {}.'.format(name, player.score))
exceptions.GameOver.add_score(name, player.score)
raise exceptions.GameOver
Copy link

Choose a reason for hiding this comment

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

?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Вызываю здесь исключение ГеймОвер, чтобы выйти из бесконечного цикла и не использовать дополнительные условия.

Copy link

Choose a reason for hiding this comment

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

Почему тогда не отлавливать исключение вне цикла?

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