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