Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
  • Loading branch information
andriy-py committed Apr 24, 2024
1 parent f6efb06 commit 1ac3ce8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,14 @@ def fire(self, row: int, column: int) -> str:
if all(not deck.is_alive for deck in self.decks):
self.is_drowned = True
return "Sunk!"
else:
return "Hit!"
else:
return "Miss!"
return "Hit!"
return "Miss!"


class Battleship:
def __init__(self, ships: list) -> None:
self.field = {}
self.ships = ships
for ship in ships:
start, end = ship
for start, end in ships:
new_ship = Ship(start, end)
for deck in new_ship.decks:
self.field[(deck.row, deck.col)] = new_ship
Expand Down

0 comments on commit 1ac3ce8

Please sign in to comment.