Skip to content

Instantly share code, notes, and snippets.

@fenixbrassi
Created December 18, 2013 01:19
Show Gist options
  • Save fenixbrassi/8015793 to your computer and use it in GitHub Desktop.
Save fenixbrassi/8015793 to your computer and use it in GitHub Desktop.
Array Example of usage
#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