Pipes - Bianca and Rebecca - Word_Guess#4
Pipes - Bianca and Rebecca - Word_Guess#4biciclista22 wants to merge 15 commits intoAda-C8:masterfrom
Conversation
Word-Guess GameWhat We're Looking For
Great work overall! I've noted a couple of places below where your code could be better organized, but in general things look quite solid. Keep up the good work! |
| # pull word from dictionary.txt | ||
| class Word | ||
| attr_reader :game_word | ||
|
|
There was a problem hiding this comment.
I really like the idea of having a separate class to handle the word. If you wanted to expand this functionality, you might make this class keep track of guessed letters and the hidden version of the word as well. Then the User class would just be concerned with interacting with the user, not with game logic.
| def user_input | ||
| #loop to confirm user has included a new guess | ||
| # if new guess, added to guess array | ||
| loop do |
There was a problem hiding this comment.
I like that this is its own method, but it ends up being pretty complex. Would it be possible to break this up further into several smaller methods? For example, you could have:
- A method that gets input from the user and verifies it's OK
- A method that handles a correct guess
- A method that handles an incorrect guess
It seems like you're almost on that track with the right_guess and wrong_guess methods below.
| @@ -0,0 +1,7 @@ | |||
| achiever | |||
| adversary | |||
| affix | |||
There was a problem hiding this comment.
I like that you put your list of words in a separate file! Making a distinction between logic and data is an important part of programming, and we'll be talking about this theme more as the class goes on.
| @bombs = [ | ||
| " | ||
|
|
||
|
|
There was a problem hiding this comment.
As before, I love the idea of putting all the art data into a separate file.
Word Guess
Congratulations! You're submitting your assignment.
Comprehension Questions