-
Notifications
You must be signed in to change notification settings - Fork 27
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
Ampers: Nicoleta && Kate #14
base: master
Are you sure you want to change the base?
Conversation
Word-Guess GameWhat We're Looking For
|
puts "\n------------------------------------------" | ||
|
||
|
||
if word.letters_array.include?(guess) # if guess is right |
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.
You can break out the code that handles the logic of checking to see if the letter is in the word and updating the guesses & blanks_array into a helper method and let this method focus on the user input.
puts art.play_art | ||
puts "\t#{word.blanks_array.join(" ")}" | ||
print "\nPlease guess a letter: " | ||
guess = gets.chomp |
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.
It is important to "trap" user input so they can't enter an invalid letter. You could also wrap the act of guessing into a helper method.
## End Word Class | ||
|
||
## Start Art Class | ||
class Art |
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.
Does the Art
need a class or would a method do as well?
attr_accessor :art | ||
|
||
def initialize | ||
@art = art |
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.
This sets @Art to itself, doing nothing.
Thank you @CheezItMan for all the feedback! It's truly appreciated! |
Word Guess
Congratulations! You're submitting your assignment.
Comprehension Questions
bad_guesses
is not used outside of that loop.game.choose_word
andgame.word.split
.guess
method. We feel that it's too large, and would like to know if there might have been an easier way to break it down. THANK YOU!! :)