|
|
@ -69,27 +69,28 @@ class Machine:
|
|
|
|
def evolve(self):
|
|
|
|
def evolve(self):
|
|
|
|
ret = True
|
|
|
|
ret = True
|
|
|
|
if self.r.read():
|
|
|
|
if self.r.read():
|
|
|
|
|
|
|
|
self.r.write(self.card.one_write)
|
|
|
|
|
|
|
|
print(self.r)
|
|
|
|
if self.card.one_move:
|
|
|
|
if self.card.one_move:
|
|
|
|
self.r.left()
|
|
|
|
self.r.left()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.r.right()
|
|
|
|
self.r.right()
|
|
|
|
self.r.write(self.card.one_write)
|
|
|
|
|
|
|
|
if not self.card.one_next:
|
|
|
|
if not self.card.one_next:
|
|
|
|
ret = False
|
|
|
|
ret = False
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.card = Card(self.card.one_next)
|
|
|
|
self.card = Card(self.card.one_next)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.r.write(self.card.zero_write)
|
|
|
|
|
|
|
|
print(self.r)
|
|
|
|
if self.card.zero_move:
|
|
|
|
if self.card.zero_move:
|
|
|
|
self.r.left()
|
|
|
|
self.r.left()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.r.right()
|
|
|
|
self.r.right()
|
|
|
|
self.r.write(self.card.zero_write)
|
|
|
|
|
|
|
|
if not self.card.zero_next:
|
|
|
|
if not self.card.zero_next:
|
|
|
|
ret = False
|
|
|
|
ret = False
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.card = Card(self.card.zero_next)
|
|
|
|
self.card = Card(self.card.zero_next)
|
|
|
|
|
|
|
|
|
|
|
|
print(self.r)
|
|
|
|
|
|
|
|
return ret
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|