Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 # won, lost, or neither, and take

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 # won, lost, or neither, and take the appropriate action. 53 # Notice that the show.erb template expects to use the instance variables #wrong_guesses and word_with_guesses from @game. get '/show' do ### YOUR CODE HERE ### erb :show # You may change/remove this line end 5555 54 56 57 58 59 60 61 62 63 64 @game HangpersonGame.new(word) redirect '/show' end # Use existing methods in HangpersonGame to process a guess. # If a guess is repeated, set flash[:message] to "You have already used that letter." # If a guess is invalid, set flash[:message] to "Invalid guess." post '/guess' do letter = params[:guess].to_s [0] ### YOUR CODE HERE ### redirect '/show' end # Everytime a guess is made, we should eventually end up at this route. # Use existing methods in HangpersonGame to check if player has get '/win' do ### YOUR CODE HERE ### erb :win # You may change/remove this line end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions