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 - Steffany Brown & Madaleine Shields #26

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

Ampers - Steffany Brown & Madaleine Shields #26

wants to merge 11 commits into from

Conversation

madaleines
Copy link

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 did pretty good. We played off each others strengths and kept communication open. Not one person was pulling more weight than the other
For each partner what parts of the project did you find challenging? Finding a common ground where to start
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? in the Word class when creating a word it generates a new word
Describe an instance where you used a local variable instead of an instance variable. Why did you make that choice? within our active_play method within the Word Guess Game class, so the whole game play could run within the class itself
What code, if any, did you feel like you were duplicating more than necessary? Original versions separated the game into two classes for the levels. We redefined the levels in once class and cut the code drastically as no duplicate was needed
Is there a specific piece of code you'd like feedback on? how to refactor it better? The active_play section got clunky

@tildeee
Copy link

tildeee commented Feb 22, 2018

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. repeated just the commit message "Word-Guess" a few times
Readable code with consistent indentation. x
Answered comprehension questions x
Product Functionalities
Created a Class to encapsulate game functionality. x
Used methods to DRY up your code. used methods to set state often. didn't define methods for repeated behaviors or to split up code
Created instance variables & local variables where appropriate. x
Used Arrays to store lists of letters guessed. x
Used variables & random numbers to allow the game to function with multiple words, no hard-coded answers. x
Programmed "defensively" to detect errors in user input. x

Good job overall

Your game works really well, and I like the theme! :) I like the use of Faker and colorize. Poor Growlithe...

The two classes you two made are WordGuessGame and GenerateWord.

About the GenerateWord class:

  • I see a purpose to making a GenerateWord class. To keep the convention of making it "noun," I may suggest calling it WordGenerator.
  • Even so, it ended up being a very small class. The functionality that was in the initialize was it put it in an instance variable generate_word. It might make more sense to make a method named generate_word and put that method somewhere else, instead of making its own class.

About the WordGuessGame class:

  • Yes, I definitely agree that the active_play method got really hairy. It's so long! And so complex, it makes it hard to read. Even though you two had great indentation, when conditionals get very deep like that, it made it tricky for me to see where one conditional ended or started. Even though you didn't have much repeated code, there are chunks of logic that could be pulled into a separate method. If you separate some code into another method, you can just call that method and it will reduce the length of active_play. (Admittedly, by shoving that code somewhere else, but it becomes way easier to work with, I promise!)
  • I agree with your decision to make a WordGuessGame class though :) Also using methods to set instance variable values is pretty great.

I encourage both of you to think about how Object Oriented design can help us program Classes that have things (state) and do things (behavior). Let me know if you have questions about design in upcoming projects. :)

Good work overall

@word = word
@tries = tries
@lives = ""
@user_guess
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line @user_guess doesn't do anything

def easy_level
@lives = 5
@user_guess = ""
puts active_play(@user_guess)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this line (and in the last line of the method hard_level, you two wrote puts active_play(@user_guess). This implies that you want to print the returned value of the method active_play, which in most cases is nil or at least isn't important. You should probably just invoke the method without puts, as active_play(@user_guess)

puts active_play(@user_guess)
end

def active_play(user_guess)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you call the method active_play, it doesn't actually do anything with the input so you don't really need the parameter I think.

correct_array = []
incorrect_array = []
new_array =[]
another_array = []
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new_array and another_array are never used

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.

2 participants