-
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: Abinnet, Alex #19
base: master
Are you sure you want to change the base?
Conversation
…d, added more flowers, formatted display, added color
Word-Guess GameWhat We're Looking For
|
@@ -0,0 +1,133 @@ | |||
require 'faker' #comment ln:50 && uncomment ln:51 for harry potter theme | |||
require 'random_word_generator' |
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.
Interesting that you found this gem, nice work!
end | ||
end | ||
|
||
class Display |
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 class is indented, it shouldn't be.
quit_game = GamePlay.new("n") | ||
quit_game.quit_or_play_game | ||
elsif @word.include?(@letter) | ||
@progress = progress.split(" ") |
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.
Clever use of spaces (" ") to separate the underscores and removing them before you search for the letter. This is a bit inefficient, because each deletion and insertion requires large portions of the array to be updated, but for small words it's reasonable.
if word_array.join(" ") == user_guess.progress | ||
puts "\nCongrats! You win!" | ||
exit | ||
end |
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.
error in indentation
attr_accessor :word | ||
|
||
def initialize | ||
@word = 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.
What is this accomplishing? word
is a helper method for @word
so this isn't doing anything useful. Maybe you should do:
@word = create_fake_word
And have create_fake_word
only return an answer, not using an instance variable.
Word Guess
Congratulations! You're submitting your assignment.
Comprehension Questions