Created
February 27, 2014 18:08
-
-
Save FrancisGX/9255523 to your computer and use it in GitHub Desktop.
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
def words | |
File.open('/usr/share/dict/words').to_a.map { |word| word.chomp } | |
end | |
def count | |
puts "There are this many words in the dicshonary #{words.length}" | |
end | |
def search | |
count | |
puts "Type something yolo." | |
input = gets.chomp.downcase | |
result = words.keep_if { |word| word.include?(input) } | |
puts "There are no words that match you search, jk #{result.length}" | |
print result | |
end | |
search |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment