Skip to content

Instantly share code, notes, and snippets.

@MelanieS
Created November 25, 2010 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MelanieS/715031 to your computer and use it in GitHub Desktop.
Save MelanieS/715031 to your computer and use it in GitHub Desktop.
words = []
puts 'I am The Sorter! Enter many words. Hit enter after each word. When you
are done entering words, hit enter on an empty line.'
input = gets.chomp
words.push input
while input != ''
input = gets.chomp
words.push input
end
words.pop
puts 'Here is your old, crappy list:'
puts words.to_s
words.sort!
puts 'Here is your new, awesome list:'
puts words.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment