Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #325

Closed
wants to merge 2 commits into from
Closed

Solution #325

wants to merge 2 commits into from

Conversation

YuliiaSaliuta
Copy link

No description provided.

app/main.py Outdated
Comment on lines 39 to 40
deck = self.get_deck(row, column)
deck.is_alive = False
Copy link

Choose a reason for hiding this comment

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

Can your get_deck return None if there is no deck at that location?
If yes, do you think it is safe to use is_alive on the object, that potentially can be None?

Comment on lines +49 to +52
for ship in ships:
my_ship = Ship(ship[0], ship[1])
for deck in my_ship.decks:
self.field[(deck.row, deck.column)] = my_ship
Copy link

Choose a reason for hiding this comment

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

such logic better suited for some separate method, that can be called from this init

Copy link

@wQuelS wQuelS left a comment

Choose a reason for hiding this comment

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

Well done 🔥

@YuliiaSaliuta YuliiaSaliuta closed this by deleting the head repository Sep 20, 2024
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