lib/hangman/word.rb
# loads words with length between 5 and 12 from a .txt file into an array
# assumes that each word is in a separate line
loads words with length between 5 and 12 from a .txt file into an array
assumes that each word is in a separate line
loads words with length between 5 and 12 from a . txt file into an array assumes that each word is in a separate line
def load_words(file_name)
      words_loaded = []
      File.open(file_name).readlines.each do |line|
        words_loaded << line if line.length.between?(5, 12)
      end
      words_loaded
    end
def load_words ( file_name ) words_loaded = [ ] File . open ( file_name ) . readlines . each do | line | words_loaded << line if line . length . between? ( 5 , 12 ) end words_loaded end
loads words with length between 5 and 12 from a .txt file into an array
assumes that each word is in a separate line
loads words with length between 5 and 12 from a . txt file into an array assumes that each word is in a separate line
file_name
<not_specific>