Pipes - Kate Evans-Spitzer & Angela Wilson - Word-Guess#3
Pipes - Kate Evans-Spitzer & Angela Wilson - Word-Guess#3Guribot wants to merge 6 commits intoAda-C8:masterfrom
Conversation
Word-Guess GameWhat We're Looking For
Great work overall. Code is well-organized and easy to read. I've got a few specific comments below, but in general I'm quite happy with this submission. |
| user_has_won = !(game_board.blank.include?"_") | ||
| user_has_lost = game_board.tries_remaining == 0 | ||
|
|
||
| until (user_has_won || user_has_lost) |
There was a problem hiding this comment.
Since you make these calculations for user_has_won and user_has_lost multiple times, they might be a good candidate for an instance method on Board.
| puts "Please guess a letter: " | ||
| guess = gets.chomp.upcase | ||
| if game_board.letters_guessed.include?guess | ||
| puts "You've already guessed that!" |
There was a problem hiding this comment.
This logic all looks good, but the code might be a little cleaner if it were all wrapped up into its own method. Maybe call it something like take_turn.
| def initialize_word_bank | ||
| return ["ear", | ||
| "heart", | ||
| "irritate", |
There was a problem hiding this comment.
I love that you've separated your words out into a separate file. This makes it very clear which part of the program is which, and the reader doesn't have to scroll through a hundred lines of words at the top of your file.
| def display | ||
| output = "" | ||
| output += @tries_pictures[@tries_remaining-1] + "\n" | ||
| output += @blank + "\n" |
There was a problem hiding this comment.
I like that you've rolled all this up into an instance method. Very concise.
Word Guess
Congratulations! You're submitting your assignment.
Comprehension Questions