'hm'
This commit is contained in:
parent
0da51d11d7
commit
1d555b2226
19
TaskB01/run
19
TaskB01/run
@ -58,21 +58,12 @@ class automata:
|
||||
result = []
|
||||
# if the node exists
|
||||
if self.graph[q]:
|
||||
# search through all its to find value
|
||||
|
||||
for dic in self.graph[q]:
|
||||
for element in dic:
|
||||
print(element)
|
||||
|
||||
for transition in self.graph[q]:
|
||||
print(transition, i)
|
||||
try:
|
||||
if transition[i]:
|
||||
# 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(transition[i])
|
||||
except KeyError:
|
||||
# there is no value like that (element from the outside of alphabet)
|
||||
return []
|
||||
result.append(connections[value])
|
||||
# return list of next nodes
|
||||
return result
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user