Created
November 25, 2010 07:28
-
-
Save MelanieS/715031 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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