Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheremeta committed Nov 17, 2023
1 parent 3bd853b commit 510127e
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ def __init__(self, row: int, column: int, is_alive: bool = True) -> None:
self.column = column
self.is_alive = is_alive

def __repr__(self) -> str:
return f"({self.row}; {self.column})"


class Ship:
def __init__(
Expand All @@ -31,12 +28,6 @@ def __init__(
]
self.is_drowned = is_drowned

def __str__(self) -> str:
return f"{self.decks}"

def __repr__(self) -> str:
return f"{self.decks}"

def get_deck(self, row: int, column: int) -> Deck | None:
for deck in self.decks:
if deck.row == row and deck.column == column:
Expand Down Expand Up @@ -89,9 +80,9 @@ def _validate_field(self) -> None:
)

def print_field(self) -> None:
for i in range(0, 10):
for j in range(0, 10):
coord = (i, j)
for _i in range(0, 10):
for _k in range(0, 10):
coord = (_i, _k)
for coords, ship in self.field.items():
deck = ship.get_deck(*coord)
if deck is not None:
Expand Down

0 comments on commit 510127e

Please sign in to comment.