Created
December 21, 2011 04:53
-
-
Save agentfin/1504644 to your computer and use it in GitHub Desktop.
Sorting my array [Chris Pine Ch 8]
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
# alphabetting | |
puts 'Tell us some of your favorite things!' | |
# create an array | |
words = [] | |
puts words | |
while (thing = gets.chomp) != '' | |
words.push thing | |
end | |
puts words.sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment