This commit is contained in:
deadsmond 2019-11-25 20:49:27 +01:00
parent 75b7052e7c
commit 2dfadfd588

View File

@ -58,13 +58,15 @@ class automata:
def get_node_transition(self, q, i):
result = []
# if the node exists
if self.graph[q]:
try:
# search through all its connections to find value
for connections in self.graph[q]:
for value in connections:
if value == i:
# append next node
result.append(connections[value])
except KeyError:
return result
# return list of next nodes
return result