Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Ampers: Abinnet, Alex #19

wants to merge 11 commits into from

Conversation

brownav
Copy link

@brownav brownav commented Feb 14, 2018

Word Guess

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
How do you feel you and your partner did in sharing responsibilities? We switched back and forth. Sometimes it was difficult to keep driver and navigator roles strict so those were a bit fluid.
For each partner what parts of the project did you find challenging? Communicating ideas and consensus, keeping roles rigid, and differing work speeds. Abinnet has many ideas and quickly implements working code, Alex is slower and likes to vet a lot.
Describe an instance where you used a method for something to encapsulate the functionality within your class. What does it do? What are its inputs and outputs? There is a quit_or_play method in the GamePlay class which takes in user input and either quits the game or initiates a game. Outputs are starting graphics for the game, user prompt (choose letter), then chaining to another class to process the prompt response.
Describe an instance where you used a local variable instead of an instance variable. Why did you make that choice? Flowers_remaining is a local variable, it's scope is entirely in one section of the compare method. We kept it local because it changes an instance variable and is then used as a parameter for another class, it's scope didn't need to be larger.
What code, if any, did you feel like you were duplicating more than necessary? Not too much replication but there are a few joins and splits sprinkled throughout to fix variable displays and functionalities throughout.
Is there a specific piece of code you'd like feedback on? The largest piece and most important is the compare method in the Guess class.

@CheezItMan
Copy link

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. Good commit messages
Readable code with consistent indentation. Overall pretty good, you had one class indented that shouldn't have been.
Answered comprehension questions Check,
Product Functionalities
Created a Class to encapsulate game functionality. Check, I would suggest that GenerateWord isn't needed as a class. Instead I would suggest that just using create_fake_word as a method in GamePlay instead.
Used methods to DRY up your code. Check
Created instance variables & local variables where appropriate. I'm not sure you need an instance variable in GenerateWord since create_fake_word returns a word, and is all you really need.
Used Arrays to store lists of letters guessed. Check
Used variables & random numbers to allow the game to function with multiple words, no hard-coded answers. Check, used a gem!
Programmed "defensively" to detect errors in user input. This app would be better if it kept the user from entering nonsensical inputs, like a number or punctuation at prompts. Some loops that "trap" the user until a valid input would be appreciated.
Summary Nice work, you did a pretty good job using classes to encapsulate functionality and effectively used a gem to create a fun game. You hit the requirements!

@@ -0,0 +1,133 @@
require 'faker' #comment ln:50 && uncomment ln:51 for harry potter theme
require 'random_word_generator'

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

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(" ")

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

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants