Rainbow Sort Visualisations
ljs.io
ljs.io
[1] http://wollw.github.io/Cellular-Polymaton
I guess I should expand on my previous comment...
Despite what that github page says about not having any reason for making these sculptures, I'm currently thinking of them as a way to highlight the kinds of concepts and technology that our computer-saturated world relies on to operate. Of course the obvious audience is people who already have an understanding of computer science, but by making them aesthetically pleasing I hope to expose people who aren't interested in algorithms to some of the algorithms that influence or make up the technology they rely on. They're intended to be shown in a gallery space, but now that I have space to show in they're more than 500 miles away from me; hopefully I'll put a show together later this year.
Are you planning on adding more sorting algorithms like mergesort?
I did this as a quick hack on a whim about a year ago (was a visualisation I wanted to see but couldn't find one quite like this), I am pleasantly surprised by the positivity on this (I kinda posted it on a whim), so I think I will probably hack on it again :-)
It's tempting to code up a whole bunch of sorting algorithms, merge and heap sort are definitely high on the list.
https://github.com/git/git/commit/8b8dfd5132ce91f632b5303c39...
And as the others have said - your rainbow viz is really nice, in a lot of ways :)
Should exist on the web somewhere if you havn't seen it.
Another classic sorting algorithm to visualize is heapsort.
I know that isn't too obvious, but this was something of a quick hack :)
One way to do it might be to allow the user to set the timeout in your defer function.
Setting the timeout to 1 second lets the user observe each run of your algorithms. You can see the partitioning behaviour a bit better like that.
Side note: this code is pretty. I should learn coffeescript.
Thanks for your kind comment on the code qual :) personally I only see the faults, for one I am sure I could improve perf... year-old code is often that way however! :)
My estimation is that you need to refactor the algorithms such that they hold their state inside a closure, and break after a set number of swaps. Say every 300 swaps they break and the canvas updates. This kind of background processing is such a pain in javascript.
the statement is true and informative: https://github.com/polarmobile/coffeescript-style-guide#tabs...
to someone who was just learning about coffeescript.
Full source code is available at https://github.com/lorenzo-stoakes/Rainbow-Sort, no guarantees as to quality... all (4 :P) algorithms are there.
This was just a quick hack a year or so ago, am open to enhancing it though - feel free to post any suggestions over at https://github.com/lorenzo-stoakes/Rainbow-Sort/issues :)
Yeah indeed, well, hsl with varying hue and set saturation + luminescence - see https://github.com/lorenzo-stoakes/Rainbow-Sort/blob/master/....
I experimented with RGB and it really didn't work, HS(B/L) work a million times better. Took a bit of trial and error!
https://www.dropbox.com/s/0pjmjllmqh1x4ap/Screenshot%202014-...
I'm going to experiment with HSL and see if I can get it to work. Thanks again!
not as nice, but shows different algorithms and their speed
http://greggman.github.io/doodles/sort.html
click one for a larger version
PS: My method of cycle counting may not make any sense.
See https://github.com/greggman/doodles for details
I like Aldo's visualizations a bit better: http://corte.si/%2Fposts/code/sortvis-fruitsalad/index.html
Only more colourful and interactive.
Why do we educate students to re-implement sorting again?