Homework
This commit is contained in:
parent
60ae127176
commit
001f87b1d2
|
@ -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)):
|
||||
|
|
Binary file not shown.
|
@ -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"}}
|
||||
{"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"}}
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue