diff --git a/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml b/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml index 4cd2d83..f14cbbc 100644 --- a/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml +++ b/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml @@ -5,9 +5,8 @@ - - + - { + "keyToString": { + "Python.ShipField.executor": "Run", + "Python.main (1).executor": "Run", + "Python.main.executor": "Debug", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "main", + "last_opened_file_path": "Y:/Downloads/временный гит/hnc-eduard/HNS/Excercises/ShipCraft/Переделка" } -}]]> +} diff --git a/HNS/Excercises/ShipCraft/Переделка/ShipField.py b/HNS/Excercises/ShipCraft/Переделка/ShipField.py index d4b0519..467a5b0 100644 --- a/HNS/Excercises/ShipCraft/Переделка/ShipField.py +++ b/HNS/Excercises/ShipCraft/Переделка/ShipField.py @@ -110,6 +110,9 @@ class ShipField: self.ships.remove(self.ship_size) self.print_field() + if self.ship_size not in self.ships and len(self.ships) > 0: + self.ship_size = max(self.ships) + def get_ship(self, row, col): if row < 0 or row > ShipField.field_size: return diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc index 5a945b9..428d4c3 100644 Binary files a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc and b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc differ