Skip to content

Commit 18b1966

Browse files
committed
fix display bug
1 parent 715dd71 commit 18b1966

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

FiniteAutomata.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,20 @@ def displaySquare(self, fname, pname, pst, LATerminal):
6666
fromstr = 'I' + str(fromstate) + ': '
6767
for pj in pst[fromstate]:
6868
tmp = ' '
69-
for sy in LATerminal[fromstate][pj]:
70-
tmp += sy + '|'
69+
for sy in LATerminal[fromstate][(pj[0], pj[1])]:
70+
tmp += sy + '/'
7171
fromstr += pj[0] + arrow + pj[1] + comma + tmp[:-1] + '\\n'
7272
tostr = 'I' + str(state) + ': '
7373
for pj in pst[state]:
7474
tmp = ' '
75-
for sy in LATerminal[state][pj]:
76-
tmp += sy + '|'
75+
for sy in LATerminal[state][(pj[0], pj[1])]:
76+
tmp += sy + '/'
7777
tostr += pj[0] + arrow + pj[1] + comma + tmp[:-1] + '\\n'
7878
fa.node('I' + str(fromstate), label = fromstr)
7979
fa.node('I' + str(state), label = tostr)
80-
fa.edge('I' + str(fromstate), 'I' + str(state), label = list(tostates[state])[0])
80+
fa.edge('I' + str(fromstate), 'I' + str(state), label = list(tostates[state])[0])
81+
82+
fa.attr('node', shape = 'point')
83+
fa.edge('', 'I0')
84+
85+
fa.view()

0 commit comments

Comments
 (0)