-
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
Tanja and Gale WordGuess #14
base: master
Are you sure you want to change the base?
Conversation
…tter provided, otherwise leave as is
"Nope! Hint: You can get a gallon of it at Trader Joe’s, but I doubt it’s organic.", | ||
"That’s not niche enough." | ||
] | ||
puts "This hang-man game is elite and invite-only (requires a password).\nHow do you take your vegan chai?" |
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 LOVE THIS.
At first I didn't know the answer and typed "hot...?"
|
||
def reveal(guess) | ||
counter = 0 #keeps track of random_word array index number | ||
@changed = nil |
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 would probably be fine to set @changed
to false instead of nil
Word-Guess GameWhat We're Looking For
|
Great project! The project is great, looks good, and is fun. Regarding your questions on feedback around lines 12-24: your intuition is right, using |
Word Guess
Congratulations! You're submitting your assignment.
Comprehension Questions
attr_reader
s were set accordingly.guess
is the local variable. It's used that way so we would limit its scope to the block within theplay
method.guess
is provided by the user.random_word
here and there because that is the faker-generated word and it needed to be used for comparison in a loop.counter
variable in order to refer to an index of an array. I wonder if there are any enumerable methods (.map?) that could make this a bit prettier/more efficient. .