diff --git a/HNS/Excercises/ShipCraft/.idea/misc.xml b/HNS/Excercises/ShipCraft/.idea/misc.xml
index a971a2c..a6218fe 100644
--- a/HNS/Excercises/ShipCraft/.idea/misc.xml
+++ b/HNS/Excercises/ShipCraft/.idea/misc.xml
@@ -1,4 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml b/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml
index f14cbbc..d6e083c 100644
--- a/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml
+++ b/HNS/Excercises/ShipCraft/Переделка/.idea/workspace.xml
@@ -4,10 +4,7 @@
-
-
-
-
+
@@ -37,20 +34,21 @@
- {
- "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/Переделка"
+
+}]]>
+
@@ -72,6 +70,7 @@
+
@@ -93,6 +92,7 @@
+
@@ -114,6 +114,7 @@
+
@@ -169,7 +170,7 @@
file://$PROJECT_DIR$/main.py
- 136
+ 133
diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipDirection.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipDirection.cpython-311.pyc
index 1b0ea2f..d40ec1e 100644
Binary files a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipDirection.cpython-311.pyc and b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipDirection.cpython-311.pyc differ
diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc
index 428d4c3..77d8a12 100644
Binary files a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc and b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipField.cpython-311.pyc differ
diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipMode.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipMode.cpython-311.pyc
index a3b69e1..c0f7fdb 100644
Binary files a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipMode.cpython-311.pyc and b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipMode.cpython-311.pyc differ
diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipView.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipView.cpython-311.pyc
index 1f1f4c0..a778f2a 100644
Binary files a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipView.cpython-311.pyc and b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShipView.cpython-311.pyc differ
diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShootResult.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShootResult.cpython-311.pyc
index 0e00a70..d84b36b 100644
Binary files a/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShootResult.cpython-311.pyc and b/HNS/Excercises/ShipCraft/Переделка/__pycache__/ShootResult.cpython-311.pyc differ
diff --git a/HNS/Excercises/ShipCraft/Переделка/__pycache__/test_ShipField.cpython-311.pyc b/HNS/Excercises/ShipCraft/Переделка/__pycache__/test_ShipField.cpython-311.pyc
new file mode 100644
index 0000000..0679320
Binary files /dev/null and b/HNS/Excercises/ShipCraft/Переделка/__pycache__/test_ShipField.cpython-311.pyc differ
diff --git a/HNS/Excercises/ShipCraft/Переделка/test_ShipField.py b/HNS/Excercises/ShipCraft/Переделка/test_ShipField.py
index 5beeb2d..14fde4a 100644
--- a/HNS/Excercises/ShipCraft/Переделка/test_ShipField.py
+++ b/HNS/Excercises/ShipCraft/Переделка/test_ShipField.py
@@ -58,7 +58,42 @@ class TestShipField(TestCase):
def test_action(self):
self.fail()
- def test_target(self):
+ def test_target_ShipMode_PUT(self):
+ ship_field = ShipField()
+ ship_field.set_ship_size(3)
+ ship_field.set_ship_direction(ShipDirection.HORIZONTAL)
+ index = 5 * ship_field.field_size + 5
+
+ old_field_string = str.join(' ', ship_field.field)
+ ship_field.target(5, 5)
+ field_after_target = [ship_field.field[index], ship_field.field[index + 1], ship_field.field[index + 2]]
+ ship_field.field[index] = ' '
+ ship_field.field[index + 1] = ' '
+ ship_field.field[index + 2] = ' '
+
+ new_field_string = str.join(' ', ship_field.field)
+
+ self.assertListEqual(['p', 'p', 'p'], field_after_target)
+ self.assertNotIn('p', new_field_string)
+ self.assertEqual(new_field_string, old_field_string)
+
+ def test_target_ShipMode_SHOOT(self):
+ ship_field = ShipField()
+ ship_field.toggle_field_mode()
+
+ index = 5 * ship_field.field_size + 5
+
+ old_field_string = str.join(' ', ship_field.field)
+ ship_field.target(5, 5)
+ field_after_target = ship_field.field[index]
+ ship_field.field[index] = ship_field.field[index].replace('+', '')
+ new_field_string = str.join(' ', ship_field.field)
+
+ self.assertIn('+', field_after_target)
+ self.assertNotIn('+', new_field_string)
+ self.assertEqual(new_field_string, old_field_string)
+
+ def get_ship(self):
self.fail()
def test_clear_marker(self):