From e05e5fc5c74e1fab8bb655e8bc5ccf4d17177d6e Mon Sep 17 00:00:00 2001 From: Lev Date: Mon, 14 Oct 2024 22:02:59 +0300 Subject: [PATCH] ver 1.2 battle ship --- app/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 736c6d7..1f04f26 100644 --- a/app/main.py +++ b/app/main.py @@ -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): @@ -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],