Skip to content

Commit

Permalink
ver 1.2 battle ship
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev2098 committed Oct 14, 2024
1 parent b989bf9 commit e05e5fc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_deck(self, row: int, column: int) -> Deck | None:
return None

def fire(self, row: int, column: int) -> bool:
deck: Deck | None = self.get_deck(row, column)
deck = self.get_deck(row, column)
if deck and deck.is_alive:
deck.is_alive = False
if all(not d.is_alive for d in self.decks):
Expand All @@ -48,8 +48,6 @@ def __init__(self,
self.field = [["~" for _ in range(self.size)]
for _ in range(self.size)]
self.ships = [Ship(*ship) for ship in ships]
self.ship_cells = {}
self.hit_cells = set()
self._place_ships()

def _get_ship_cells(self, start: tuple[int, int],
Expand Down

0 comments on commit e05e5fc

Please sign in to comment.