D
Dylan Rodriguez
I'm trying to make a Hangman game
def guessed_word()
word_letters = @word.split("")
blank = @word.gsub(/[a-z]/, '_')
return blank
end
the array for the correct guesses made by the user is @good_guesses and
incorrect is @bad_guesses
So, my game will print out the right number of blanks for however many
letters are in the word...but I don't know how to add the elements from
@good_guesses into the correct spots.
I've tried things like
if @word.include?(@good.guesses)
right = blank.gsub(/[_]/, @good_guesses.split)
end
and things in that nature
i always end up getting an error
i have no idea what to do at this point and i've tried like 1000
combinations and i can't find an explanation anywhere
please help?
def guessed_word()
word_letters = @word.split("")
blank = @word.gsub(/[a-z]/, '_')
return blank
end
the array for the correct guesses made by the user is @good_guesses and
incorrect is @bad_guesses
So, my game will print out the right number of blanks for however many
letters are in the word...but I don't know how to add the elements from
@good_guesses into the correct spots.
I've tried things like
if @word.include?(@good.guesses)
right = blank.gsub(/[_]/, @good_guesses.split)
end
and things in that nature
i always end up getting an error
i have no idea what to do at this point and i've tried like 1000
combinations and i can't find an explanation anywhere
please help?