Advertisement
Guest User

Untitled

a guest
Nov 26th, 2012
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.22 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement