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: Nicoleta && Kate #14

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

Ampers: Nicoleta && Kate #14

wants to merge 23 commits into from

Conversation

Oh-KPond
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? It was a team effort for sure. We traded off writing methods and being the navigator.
For each partner what parts of the project did you find challenging? Kate: Variable scope when using class methods inside of the classes was difficult, as well as planning for classes needed. Nicoletta: Everything was challenging for me. I find that I don't know where to start when I get the project. Accessing information from the classes was challenging.
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? We created a guess method that looped for the game. This checked to see if a guess was correct or not and did tasks associated with the types of guesses. Its inputs were a guess, and its outputs were images and text.
Describe an instance where you used a local variable instead of an instance variable. Why did you make that choice? In our guess method, we used a local variable instead of an instance variable because bad_guesses is not used outside of that loop.
What code, if any, did you feel like you were duplicating more than necessary? We don't think that we duplicated code, but we do feel like there is some code that we shouldn't have had to write outside of the classes. e.g. game.choose_word and game.word.split.
Is there a specific piece of code you'd like feedback on? Yes, please provide feedback on our 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!! :)

@Oh-KPond Oh-KPond changed the title Ampers: Nicoletta && Kate Ampers: Nicoleta && Kate Feb 14, 2018
@CheezItMan
Copy link

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. Check, good work there
Readable code with consistent indentation. Check
Answered comprehension questions Check, I left some comments in your code, in particularly guess.
Product Functionalities
Created a Class to encapsulate game functionality. Check, although Art doesn't need to be a class.
Used methods to DRY up your code. Yes, but you could have broken up guess into several methods
Created instance variables & local variables where appropriate. Check, although Art has an unused instance variable.
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
Programmed "defensively" to detect errors in user input. No defensive programming. Something to work on!
Summary Nice work, you hit the primary requirements. Check out my notes in the code. I would suggest thinking about classes and asking yourself, does this make sense as a "Thing" that has actions it can do and things it keeps track of or only an action to be performed like drawing a cat.

puts "\n------------------------------------------"


if word.letters_array.include?(guess) # if guess is right

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

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

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

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.

@Oh-KPond
Copy link
Author

Thank you @CheezItMan for all the feedback! It's truly appreciated!

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