Originally I wrote this in Delphi 3, and later wrote a version in C# when I was trying to learn the language. When it came to trying out the HMTL5 canvas tag, Algorithm Animation seemed like the perfect application with which to try.
…I tried to learn to program by following tutorials that created programs I didn’t have the slightest interest in keeping…
Sound familiar? How many times have we followed tutorials in a book that have taught us how to write a program we have no interest in.
These examples generally start out with some problem, which and will demonstrate how this is solved with their examples. But, for me, there is no point of reference, and I have no empathy for the problem. I don’t really care about it, and as a result, don’t care about the solution. The knock on effect is generally, that I don’t learn as well.
So when i’m picking something new up, I always try to refer back to an interesting point of reference, hence attempting the Algorithm Animation.
I make no apologies for the fact that its very very limited – it was just a proof of concept more than anything else! You’ll have to refresh the page if you want to run it more than once. Hmmm….I feel a ‘reset’ button coming on.
The HTML is laughably simple. In fact, here it is:
<canvas id="myCanvas" width="300" height="170">
Fallback content, in case the browser does not support Canvas.
<input type="button" value="sort" id="sort" onclick="Sort_OnClick();"/>
It will work in the latest versions of the most common browsers (including IE9, with which it reports issues with sound and speed). If you try to access it with IE8 or lower, you get the following unequivocal message:
“Hey there, it looks like you’re using Microsoft’s Internet Explorer. Microsoft hates the Web and doesn’t support HTML5