diff --git a/HNC/Exercises/Ship_Battle/ShipField.py b/HNC/Exercises/Ship_Battle/ShipField.py index dd8b59b..c1ed018 100644 --- a/HNC/Exercises/Ship_Battle/ShipField.py +++ b/HNC/Exercises/Ship_Battle/ShipField.py @@ -30,14 +30,9 @@ class ShipField: self.field_size = obj['field_size'] self.field_mode = ShipMode.from_string(obj['field_mode']) self.ship_size = obj['ship_size'] -<<<<<<< HEAD self.ship_direction = ShipDirection.from_string(obj['ship_direction']) -======= - self.ship_direction = obj['ship_direction'] - ->>>>>>> d51d6b9fd1009b5d2eec1276597e4b6e34e005b5 def __getitem__(self, item): if item is None: return None @@ -83,10 +78,6 @@ class ShipField: self.field[row * self.field_size + c] = "r" else: self.field[row * self.field_size + col] += "+" -<<<<<<< HEAD - -======= ->>>>>>> d51d6b9fd1009b5d2eec1276597e4b6e34e005b5 def clear_marker(self): for i in range(0, len(self.field)): diff --git a/HNC/Exercises/Ship_Battle/__pycache__/ShipField.cpython-311.pyc b/HNC/Exercises/Ship_Battle/__pycache__/ShipField.cpython-311.pyc index 2d51748..e5a1d60 100644 Binary files a/HNC/Exercises/Ship_Battle/__pycache__/ShipField.cpython-311.pyc and b/HNC/Exercises/Ship_Battle/__pycache__/ShipField.cpython-311.pyc differ diff --git a/HNC/Exercises/Ship_Battle/enemy_field.json b/HNC/Exercises/Ship_Battle/enemy_field.json index e05ab3b..d12b9b2 100644 --- a/HNC/Exercises/Ship_Battle/enemy_field.json +++ b/HNC/Exercises/Ship_Battle/enemy_field.json @@ -1 +1 @@ -{"enemy_field": {"field": [" ", " ", " ", "1", "", "", "", "1", "1", "1", " ", "1", " ", " ", "", "", "", "", "", "", " ", "1", "", "", "1", "", "", "", "", "", " ", "1", "", "", "1", "", "", "", "1", "1", " ", "1", "", "", "", "", "", "", "", "", " ", "", "", "", "", "", " ", "", "", "", "", "", "1", "", "", "", "", "", "1", " ", "", "", "", "", "", "", "", "", "", " ", "", "", "", "", " ", "", " ", " ", " ", " ", "1", "1", " ", " ", "1", "", " ", "1", "1", "1"], "ships": [], "field_size": 10, "field_mode": "PUT", "ship_size": 1, "ship_direction": "VERTICAL"}} \ No newline at end of file +{"enemy_field": {"field": ["1", " ", " ", "1", "", "", "", "1", "1", "1", "1", "", " ", " ", "", "", "", "", "", "", "1", "", "", "", "1", "", "", "", "", "", "1", "", "", "", "1", "", "", "", "1", "1", "", "", "", "", "", "", "", "", "", "", " ", "", "", "", "", "", "", "", "", "", "", "", "1", "", "", "", "", "", "1", " ", "", "", "", "", "", "", "", "", "", " ", "", "", "", "", " ", "", " ", " ", " ", " ", "1", "1", " ", " ", "1", "", " ", "1", "1", "1"], "ships": [], "field_size": 10, "field_mode": "PUT", "ship_size": 4, "ship_direction": "VERTICAL"}} \ No newline at end of file diff --git a/HNC/Exercises/Ship_Battle/main.py b/HNC/Exercises/Ship_Battle/main.py index 5ebde58..821ddcd 100644 --- a/HNC/Exercises/Ship_Battle/main.py +++ b/HNC/Exercises/Ship_Battle/main.py @@ -40,10 +40,6 @@ def colorize(field, buttons): bg = 'red' if "+" in field.field[i]: bg = 'orange' -<<<<<<< HEAD -======= - ->>>>>>> d51d6b9fd1009b5d2eec1276597e4b6e34e005b5 buttons[i].configure(bg=bg) @@ -142,7 +138,6 @@ savebutton.grid(column=0, row=11, columnspan=4) loadbutton = Button(window, text='Load', width=20, height=2, command=loadbutton_click) loadbutton.grid(column=5, row=11, columnspan=4) -<<<<<<< HEAD savebutton_enemy = Button(window, text='Save_enemy', width=20, height=2, command=savebutton_click_enemy) savebutton_enemy.grid(column=11, row=11, columnspan=4) @@ -151,6 +146,3 @@ loadbutton_enemy.grid(column=16, row=11, columnspan=4) window.mainloop() -======= -window.mainloop() ->>>>>>> d51d6b9fd1009b5d2eec1276597e4b6e34e005b5