WiP commit to not loose changes
This commit is contained in:
parent
d22710da82
commit
1d9b2f0b34
|
@ -135,12 +135,22 @@ class ShipField:
|
|||
if value is None:
|
||||
return
|
||||
|
||||
if type(value) is not int and value.isnumeric:
|
||||
if type(value) is str and value.isnumeric():
|
||||
value = int(value)
|
||||
|
||||
if type(value) is int and 1 <= value <= 4:
|
||||
self.ship_size = value
|
||||
|
||||
def set_ship_direction(self, value):
|
||||
if value is None:
|
||||
return
|
||||
|
||||
if type(value) is str and value.isnumeric():
|
||||
value = int(value)
|
||||
|
||||
if type(value) is int and 0 <= value <= 1:
|
||||
self.ship_direction = value
|
||||
|
||||
def toggle_ship_direction(self):
|
||||
if self.ship_direction == 0:
|
||||
self.ship_direction = 1
|
||||
|
@ -162,4 +172,4 @@ class ShipField:
|
|||
ship_string += self.field[r * self.field_size + c] + ', '
|
||||
print(ship_string[:-2])
|
||||
#print(blocked_string[:-2] + ' ' + ship_string[:-2])
|
||||
print("********************************************************************")
|
||||
print("********************************************************************")
|
||||
|
|
Loading…
Reference in New Issue