@@ -116,6 +116,49 @@ There are (at least) two main ways to implement this feature:
116116 the web page canvas. The dream here is to be able to write pure-Python modules for
117117 each custom data type, which can "pretty-print" as HTML/CSS/JS.
118118
119+ ### Holistic tabular view
120+
121+ Right now OPT displays one state at a time. For simple algorithms, students often find it helpful
122+ to have the entire state displayed in a table, and will manually insert in ` print ` statements like so:
123+
124+ <pre >
125+ i = 0
126+ numbers = []
127+
128+ while i < 6:
129+ print 'At the top i is %d' % i
130+ numbers.append(i)
131+
132+ i = i + 1
133+ print 'Numbers now: ', numbers
134+ print 'At the bottom i is %d' % i
135+
136+ print 'The numbers: '
137+
138+ for num in numbers:
139+ print num
140+ </pre >
141+
142+ Question: Can we augment OPT to provide this sort of "cumulative tabular view"?
143+ All of the data is right there in the trace; it's just a matter of visualizing it properly.
144+
145+ For instance (this output is faked, so it's not accurate):
146+
147+ i numbers code executed
148+ -------------------------------------------
149+ 0 [0] while i < 6:
150+ 1 [0, 1] i = i + 1
151+ 2 [0, 1, 2] while i < 6:
152+ 3 [0, 1, 2, 3] i = i + 1
153+ 4 [0, 1, 2, 3, 4]
154+
155+ The obvious challenge here is scalabiilty, and what happens when there are multiple frames.
156+
157+ Some ideas include:
158+ - having the user manually document (in, say, a docstring) which variables to print to the table
159+ - only printing the table for one frame at a time
160+ - or maybe nesting frames
161+
119162
120163### Custom rendering API and plugin system
121164
0 commit comments