Created
December 18, 2013 01:19
-
-
Save fenixbrassi/8015793 to your computer and use it in GitHub Desktop.
Array Example of usage
This file contains 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
#Write a program that asks user to type as many words as he/she wants. | |
#One word per line, continuing until the user presses enter on an empty line. The output of the program should be the words in alphabetical order. | |
def order_string(paragraph) | |
end | |
puts " Tell me a story " | |
story = "" | |
w = "\n" | |
until w == "" do | |
w = gets | |
story += w | |
w = w.chomp | |
end | |
puts story.split("\n").sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment