Sieve of Eratosthenes, in AngularJS, with CSS3 explosions

53 views
Skip to first unread message

xrd

unread,
Apr 4, 2014, 3:24:10 AM4/4/14
to ang...@googlegroups.com
I wrote up my thoughts on using AngularJS to build an animated Sieve of Eratosthenes. If anyone has comments, I'd love to hear them.


Chris

xrd

unread,
Apr 4, 2014, 1:14:57 PM4/4/14
to ang...@googlegroups.com
More specifically, what I would really like to know: is there a way to write this algorithm that respects O(n log n) run time when running inside the tests (using my mocked timeout that immediately resolves the callback), but then has all methods wrapped in timeouts so that the algorithm can be displayed in the browser for human consumption. Could it be rewritten with promises? Could you iterate over the functions on the scope and alias them to delay execution and perhaps even display the top of the call stack? Could you inject something before or after each digest?

xrd

unread,
Apr 14, 2014, 6:03:13 PM4/14/14
to ang...@googlegroups.com
If anyone is interested, I came up with a solution for doing the processing without the timeout callbacks, but allowed me to visualize the algorithm in a consistency and determinant way.

Reply all
Reply to author
Forward
0 new messages