Open
Conversation
… and consolidate method
…WordMechanics object as an initialize argument.
… guessed letter is included in the current word. Increment wrong guess counter if it is not.
… word array. We used the index to replace the underscore in letter holder with the correct guessed letter.
… at the same time.
…m to screen once user has made an incorrect guess
…working out the details. Added case-statements to handle wrong guesses.
…d fixed the play again bug.
… into a string so it was displayed better.
…he user does not guess the correct letter the current word underscore will print.
Word-Guess GameWhat We're Looking For
|
CheezItMan
reviewed
Feb 20, 2018
| guess_ui = GuessMechanics.new(new_word) | ||
| guess_ui.guess_letter | ||
| puts "\nDo you want to play again?" | ||
| @play_again = gets.chomp.downcase |
There was a problem hiding this comment.
I would put this into a loop that will repeat until the user picks "yes" or "no." Instead anything other than "yes" will cause the program to stop.
| print @letter_holders.join(' ') | ||
| else | ||
| puts "Oooh, that sucks. You entered the wrong letter. Draw more TROGDOR!" | ||
| print @letter_holders.join(' ') |
There was a problem hiding this comment.
You might move this puts outside the if/else block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Word Guess
Congratulations! You're submitting your assignment.
Comprehension Questions