-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipes - Bianca and Rebecca - Word_Guess #4
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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