Skip to content

lauren/diane Pipes WordGuess#2

Open
laurenelee wants to merge 17 commits intoAda-C8:masterfrom
laurenelee:master
Open

lauren/diane Pipes WordGuess#2
laurenelee wants to merge 17 commits intoAda-C8:masterfrom
laurenelee:master

Conversation

@laurenelee
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 feel great. We both worked for the 3+ hours together at school and then separately at home afterward. Today we merged code and continued sharing responsibilities during the final hour of work.
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? The add_incorrect_guesses method reads the user input and assesses whether or not the input is present in the randomly generated word and then increments incorrect guesses. It also keeps a record of the incorrect guesses for the user to see when preparing their next guess.
Describe an instance where you used a local variable instead of an instance variable. Why did you make that choice? The input became a local variable and we passed it into the methods.
What code, if any, did you feel like you were duplicating more than necessary? The status of the game, whether win or lose could have been more concise.
Is there a specific piece of code you'd like feedback on? We would really like to learn more about how to avoid puts in our methods. We know it's not ideal. Also, why is it that you can call game1.random_word in line 89... shouldn't we need a method for that? Calling a dot notation on an instance variable seems wrong!

@PilgrimMemoirs
Copy link

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. Mostly Good - good amount of commits for a project of this size. Last few messages should be more specific, ex: "refactor check score functionality"
Readable code with consistent indentation. Well Done
Answered comprehension questions Well Done - random_word does have a method, on line 5 this excerpt of code attr_reader :random_word is making that reader method.
Product Functionalities
Created a Class to encapsulate game functionality. Mostly Good - See note under Game Logic below
Used methods to DRY up your code. Some Improvement - See notes on centipede instances and @incorrect_guess. In the conditional, within the loop at the bottom, (lines 92 & 94) puts game1.check_guess(input) doesn't need to be repeated in the conditional, since it gets called no matter the condition.
Created instance variables & local variables where appropriate. Well Done
Used Arrays to store lists of letters guessed. Well Done
Used variables & random numbers to allow the game to function with multiple words, no hard-coded answers. Well Done
Programmed "defensively" to detect errors in user input. Well Done - handled guessing the same letter.
Overall Submission meets project expectations. Nice work!
Additional Feedback
@incorrect_guess Do you need this counter? Is there any benefit to having this over checking the length of the @list_guesses array?
generate_answer method You start with a string, make an array with each letter of that string into it's own element, and then make the string again from that array. That last step you can skip if you assign @string_word right away, like so: @random_word = RandomWord.nouns(not_shorter_than: 3, not_longer_than: 7).next and then you can assign @random_word @random_word = @string_word.chars
Centipede Instances You are currently making a new centipede object every time you need to display the ascii art. Instead of creating a new instance every time, you should initialize with a new object and reference that same object when needing to display the art.
Game Logic There is some logic for your game that exists out of the class, on the bottom of the page. At minimum, displaying the centipede art and the conditional is functionality that should be handled by the Game class.
Centipede as a class At this stage of the game, is it appropriate for centipede to have it's own class? Because it only has a single attribute with the array of strings, it should not be one. There are not other attributes or behaviors that justify having it as one.

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