Skip to content

Commit

Permalink
'Solution'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna Lyubinska committed Oct 7, 2024
1 parent 65523a1 commit b8a5518
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def validate_field(self) -> None:

for row, column in self.field:
ship = self.field[row, column]
for x in range(-1, 2):
for y in range(-1, 2):
next_cell = (row + x, column + y)
for x_cell in range(-1, 2):
for y_cell in range(-1, 2):
next_cell = (row + x_cell, column + y_cell)

if (next_cell in self.field
and self.field[next_cell] != ship):
Expand Down

0 comments on commit b8a5518

Please sign in to comment.