Created
September 16, 2015 20:46
-
-
Save noahc/00617fdc43e08a91840f to your computer and use it in GitHub Desktop.
download to a directory and run via `ruby ./words.rb`
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 = [] | |
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
download to a directory and run via
ruby ./words.rb