Skip to content

Pipes - Anders and Tamira - Word-Guess #25

Open
tvojnar wants to merge 13 commits intoAda-C8:masterfrom
tvojnar:master
Open

Pipes - Anders and Tamira - Word-Guess #25
tvojnar wants to merge 13 commits intoAda-C8:masterfrom
tvojnar:master

Conversation

@tvojnar
Copy link

@tvojnar tvojnar commented Aug 22, 2017

Word Guess

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
How do you feel you and your partner did in sharing responsibilities? Great!
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? To help encapsulate the functionality of our class we created private win and lose methods. Win and lose were called within the instance methods of the Word class to check if the game was over, but the user could not access these private methods. The input to to the win method were the instance variables @dash_array and @word_array. The outputs of the win method was a string telling the user that they had won the game and accompanying ASCII art.
Describe an instance where you used a local variable instead of an instance variable. Why did you make that choice? We used the local variable 'index' to store the indices in the @word_array where the letter guessed was present. We used a local variable of this because we didn't need to store this information after the method was completed.
What code, if any, did you feel like you were duplicating more than necessary? In the guess_right_word method and the win method we checked if an array was equal to the @word_array. To make our code DRY we could have created a method that took an array as an argument and checked if that array was equal to the @word_array.
Is there a specific piece of code you'd like feedback on? We would love feedback on if there is a better way to preform the functionality in our check_if_in_word method. Also we would like to know if there is a better way to produce specific error messages for lots of different types of errant user input.

@PilgrimMemoirs
Copy link

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. Well Done.
Readable code with consistent indentation. Mostly Good - line 83-111 indented in one tab too much
Answered comprehension questions Well Done
Product Functionalities
Created a Class to encapsulate game functionality. Some Improvement - There is still quite a bit of logic pertinent to the game that is being handled outside of the class - Just about everything (especially the conditionals and loops) should be defined in methods within the class.
Used methods to DRY up your code. Mostly Good - Code is DRY, but more functionality should be wrapped up in methods (as mentioned above)
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
Overall Submission meets most expectations for this project - there is a bug, addressed below, that
Additional Feedback
check_if_in_word method It is becoming quite large and hard to read, especially within the conditional. There is a lot happening in there that could be split into their own methods with semantic names to make that conditional more readable. You also do not need to iterate twice, while you are iterating the first time, you can change the @dash_array, like so: `@word_array.each_index.select{
Bug - Words with repeated letters If a word has more than one of the same letter, there is no way to win. In the second iteration block, starting on line 54, a value is returned within, which will end the iteration after one loop - even if there is more than one letter that needs to be updated in the @dash_array. So the @dash_array only ever updates with one letter.

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