3 ms·
Shameless-self-plug: I once wrote a generic algorithm visualizer where you write your own algorithm, and a view function. Then the framework records the state
by awalGarg 10y ago
Shameless-self-plug:
I once wrote a generic algorithm visualizer where you write your own algorithm, and a view function. Then the framework records the state of the algorithm as it changes and passes it to the view function. Then you can play the states like you play a video, go back and forth etc. Here is an example with bubble-sort: http://awal.js.org/alpg/?gist=8b5c6679edc3b85106fb http://awal.js.org/alpg/?gist=8b5c6679edc3b85106fb (hit run, then play/rewind/etc.)
The source is available at https://github.com/awalGarg/alpg https://github.com/awalGarg/alpg if anyone feels like dabbling in.