Open
Description
Hello
I don't understand why my program passes this test ?
Instead of "a---a-", my method returns "------" as I checked with byebug. Also, my post /guess
is still empty!
post '/guess' do
letter = params[:guess].to_s[0]
### YOUR CODE HERE ###
flash[:message]="You have already used that letter." if not @game.word.include?(letter)
redirect '/show'
end
Given I start a new game with word "animal" # features/step_definitions/game_steps.rb:12
[47, 56] in /home/user/edx/agile_dev_basics/hw-sinatra-saas-hangperson/lib/hangperson_game.rb
# def word_with_guesses
47: dashed_word=@word.clone
48: dashed_word.each_char do |l|
49: dashed_word.gsub! l,"-" if not guesses.include?(l)
50: end
51: byebug
=> 52: dashed_word
53: end
54:
55: def check_win_or_lose
56: return :win if not word_with_guesses.include? ("-")
(byebug) "------"
(byebug) When I guess "a" # features/step_definitions/game_steps.rb:19
Then I should see "a---a-" within "span.word" # features/step_definitions/game_steps.rb:71
Kind regards.
Metadata
Assignees
Labels
No labels
Activity