|
|
@ -51,12 +51,15 @@ class Card:
|
|
|
|
with open("cards/" + str(self.number) ,'r') as f:
|
|
|
|
with open("cards/" + str(self.number) ,'r') as f:
|
|
|
|
for row in f:
|
|
|
|
for row in f:
|
|
|
|
line.append(row[:-1])
|
|
|
|
line.append(row[:-1])
|
|
|
|
self.zero_write = bool(line[0])
|
|
|
|
self.zero_write = bool(int(line[0]))
|
|
|
|
self.zero_move = bool(line[1])
|
|
|
|
self.zero_move = bool(int(line[1]))
|
|
|
|
self.zero_next = int(line[2])
|
|
|
|
self.zero_next = int(line[2])
|
|
|
|
self.one_write = bool(line[3])
|
|
|
|
self.one_write = bool(int(line[3]))
|
|
|
|
self.one_move = bool(line[4])
|
|
|
|
self.one_move = bool(int(line[4]))
|
|
|
|
self.one_next = int(line[5])
|
|
|
|
self.one_next = int(line[5])
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
|
|
|
return "Card number: " + str(self.number) + "\nIf 1 :\nMove: " + str(self.one_move) + "\nWrite: " + str(self.one_write) + "\nNext card: " + str(self.one_next) + "\nIf 0 :\nMove: " + str(self.zero_move) + "\nWrite: " + str(self.zero_write) + "\nNext card: " + str(self.zero_next) + '\n'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Machine:
|
|
|
|
class Machine:
|
|
|
|
def __init__(self):
|
|
|
|
def __init__(self):
|
|
|
@ -93,4 +96,5 @@ class Machine:
|
|
|
|
turing = Machine()
|
|
|
|
turing = Machine()
|
|
|
|
run = True
|
|
|
|
run = True
|
|
|
|
while run:
|
|
|
|
while run:
|
|
|
|
|
|
|
|
# print (turing.card)
|
|
|
|
run = turing.evolve()
|
|
|
|
run = turing.evolve()
|
|
|
|