Skip to content

Comments

Pipes - Bianca and Rebecca - Word_Guess#4

Open
biciclista22 wants to merge 15 commits intoAda-C8:masterfrom
biciclista22:master
Open

Pipes - Bianca and Rebecca - Word_Guess#4
biciclista22 wants to merge 15 commits intoAda-C8:masterfrom
biciclista22:master

Conversation

@biciclista22
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? I think we shared responsibilities fairly evenly. We shared keyboard time and planning time as well as being honest about when we needed respective breaks. Also, although not formalized, we were able to request keyboard time and shared it well.
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 used a method called right_guess which gives a response letting the user know they guessed one of the letters correctly.
Describe an instance where you used a local variable instead of an instance variable. Why did you make that choice? We used a local variable called index_array to store the locations of correct letters and then place them in the corresponding locations in the correct guesses array. We made that choice because we only needed to know the indices when the user correctly guessed a letter.
What code, if any, did you feel like you were duplicating more than necessary? We feel, upon looking at our code, that we could have created a method to show the current version of the correct letter guesses and dashes. We use it at least twice in various sections of one of our methods.
Is there a specific piece of code you'd like feedback on? Perhaps some feedback on our class organization. We pass one class into another - the Word into the User class - but perhaps there is a better way to do that.

@droberts-sea
Copy link

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. yes - good work!
Readable code with consistent indentation.
Answered comprehension questions yes
Product Functionalities
Created a Class to encapsulate game functionality. yes
Used methods to DRY up your code. yes
Created instance variables & local variables where appropriate. yes
Used Arrays to store lists of letters guessed. yes
Used variables & random numbers to allow the game to function with multiple words, no hard-coded answers. yes
Programmed "defensively" to detect errors in user input. some - guessing the same thing multiple times is guarded against, but special characters or multi-character strings just register as wrong guesses

Great work overall! I've noted a couple of places below where your code could be better organized, but in general things look quite solid. Keep up the good work!

# pull word from dictionary.txt
class Word
attr_reader :game_word

Choose a reason for hiding this comment

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

I really like the idea of having a separate class to handle the word. If you wanted to expand this functionality, you might make this class keep track of guessed letters and the hidden version of the word as well. Then the User class would just be concerned with interacting with the user, not with game logic.

def user_input
#loop to confirm user has included a new guess
# if new guess, added to guess array
loop do

Choose a reason for hiding this comment

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

I like that this is its own method, but it ends up being pretty complex. Would it be possible to break this up further into several smaller methods? For example, you could have:

  • A method that gets input from the user and verifies it's OK
  • A method that handles a correct guess
  • A method that handles an incorrect guess

It seems like you're almost on that track with the right_guess and wrong_guess methods below.

@@ -0,0 +1,7 @@
achiever
adversary
affix

Choose a reason for hiding this comment

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

I like that you put your list of words in a separate file! Making a distinction between logic and data is an important part of programming, and we'll be talking about this theme more as the class goes on.

@bombs = [
"


Choose a reason for hiding this comment

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

As before, I love the idea of putting all the art data into a separate file.

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