From 001f87b1d2eed263a6f28d4d106473517859c82a Mon Sep 17 00:00:00 2001 From: danii Date: Mon, 6 May 2024 18:54:52 +0200 Subject: [PATCH] Homework --- HNC/Exercises/Ship_Battle/ShipField.py | 9 --------- .../__pycache__/ShipField.cpython-311.pyc | Bin 13858 -> 13858 bytes HNC/Exercises/Ship_Battle/enemy_field.json | 2 +- HNC/Exercises/Ship_Battle/main.py | 8 -------- 4 files changed, 1 insertion(+), 18 deletions(-) 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 2d51748bb8333328f8a10891b38b6eedf4614408..e5a1d608c02809f838709524b7d7e911716f849b 100644 GIT binary patch delta 271 zcmZ3KvnYpeIWI340}wprvP_$(x{>c08>95*uWbJq8C5oa;kd=bXt4P_HxCP=?dCiD zVT_DCn~ep}GBO5jW)!YsW{lokBc{#9ShRVCOcx9Ha-cEACxAo)!{h`-mCcEYsf>)< zHXm2AWn$d9nN@W^6XU7PN7Wsf7%y*T*NSIkyt_GFyOojg`R2DeZj6lYHk;_JWn%oY z`H_J-6Vrc&&D_QsKvzsQF;S40;AU0)zyK$tgjuaWFu)0|&BZ1KjP`ZRj8Y#Mu#+Fb N;$Lvc7D)qL4FJv4PGJB5 delta 271 zcmZ3KvnYpeIWI340}wo!Zr62K 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