Inspired by my classmate Alex Persian's Bubble Sort Exploration after our first inaugural "Algorithm Friday" (see below), I spent a couple of hours this morning putting together a little bubble sort demo of my own:



Bubble Sort Example!

...which has inspired me to start making a habit of validating and testing every function I ever write from now on. On a related note, this is easily breakable ;). Have fun!

On a totally unrelated note, I just replaced by beloved (and very broken) MacBook Pro with one of the new 13" Retina Pro's (review), and decided to use this as an opportunity/excuse to start fresh, as far as coding workflow goes. As such, the bubble sort example was created and uploaded entirely through the terminal and Sublime Text. Not a huge accomplishment, but through the process, I learned how to create files from the terminal (touch), open Sublime Text from the terminal and edit my bash profile/PATH (linky), and upload the project to my website (Dreamhost SSH). I also forced myself to remember how to generate random integers between two values (which was probably made significantly more difficult due to it being 5AM). In JavaScript:


( Math.floor( Math.random() * (high - low + 1) ) + low );

Not a bad little exercise for an early Saturday morning!



FYI: Algorithm Fridays get pretty nuts: