Skip to content

Instantly share code, notes, and snippets.

@noahc
Created September 16, 2015 20:46
Show Gist options
  • Select an option

  • Save noahc/00617fdc43e08a91840f to your computer and use it in GitHub Desktop.

Select an option

Save noahc/00617fdc43e08a91840f to your computer and use it in GitHub Desktop.
download to a directory and run via `ruby ./words.rb`
words = []
word = ""
while word != "\n"
if words.length == 0
print "Enter your first word: "
else
print "Enter another word: "
end
word = gets
words << word.chomp unless word.chomp.empty?
end
words.sort.each do |w|
p w
end
@noahc
Copy link
Author

noahc commented Sep 16, 2015

download to a directory and run via ruby ./words.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment