lib/hangman/word.rb
# adds an incorrect guess to the @wrong_guesses instance variable array
adds an incorrect guess to the @wrong_guesses instance variable array
adds an incorrect guess to the @wrong_guesses instance variable array
def add_incorrect_guess(letter)
      if @wrong_guesses.empty?
        @wrong_guesses << letter
        @current_wrong_guesses += 1
      elsif @wrong_guesses.include?(letter)
        puts 'Letter already guessed! try another one!'
      else
        @wrong_guesses << letter
        @current_wrong_guesses += 1
      end
    end
def add_incorrect_guess ( letter ) if @wrong_guesses . empty? @wrong_guesses << letter @current_wrong_guesses += 1 elsif @wrong_guesses . include? ( letter ) puts 'Letter already guessed! try another one!' else @wrong_guesses << letter @current_wrong_guesses += 1 end end
adds an incorrect guess to the @wrong_guesses instance variable array
adds an incorrect guess to the @wrong_guesses instance variable array
letter
<not_specific>