Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 26th, 2012  |  syntax: Ruby  |  size: 0.22 KB  |  views: 95  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. e = 0
  2.  
  3. while e != words.length - 1
  4.   if words[e][0] > words[e + 1][0]
  5.     spec_word = words[e]
  6.     words[e] = words[e + 1]
  7.     words[e + 1] = spec_word
  8.     if e > 0
  9.       e -= 1
  10.     end
  11.   else
  12.     e += 1
  13.   end
  14. end