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

&&: Brittany Jones and Monalisa's word guess #12

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

Conversation

MonalisaC
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? Brittany says: I feel like my parter took lead, and understood the concepts much better that I did. I feel that may partner helped me understand the concepts along the way, and gave me smaller tasks to try attempting on my own and bring back to the code. Monalisa says: We both understood each other, and gave each other space to think about the concepts of the code. It went well for us as a team.
For each partner what parts of the project did you find challenging? Brittany says: I found it hard to come up with the ideas so quickly, without having time on my own to organize my thoughts. It was helpful to talk out my ideas with my partner, who was then able to help me figure out how to map my ideas into an actual working code. Monalisa says: Breaking down the problem into smaller chunks was the main challenge. Also, updating the board method proposed some challenges for us. By updating board, we mean taking the letter and matching it with the letters of the word that was generated.
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 to generate the image of the flower for each attempt left. The method will reduce the flower petals with each wrong attempt. The inputs are the attempts left. The output is the corresponding ASCII art attempt.
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 letter_guessed to store the return value of the players guessed letter.
What code, if any, did you feel like you were duplicating more than necessary? We tried to avoid duplication.
Is there a specific piece of code you'd like feedback on? Brittany and Monalisa says: We would like to get some feedback on the usage of classes. Is there any way to simplify/ make better, the structure of the entire code.

@CheezItMan
Copy link

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. Check, nicely done
Readable code with consistent indentation. Check
Answered comprehension questions Check, for the classes, I was going to mention this below, but the Image class doesn't seem necessary, it seems more like a method as part of Game. You don't need the @image_type instance variable and it only has one method so... Also Player seems a little strange as the Player is picking a theme, which would seem to be a game feature.
Product Functionalities
Created a Class to encapsulate game functionality. You created a Game class to do the bulk of the work. I would suggest a SecretWord method to handle tracking the word and guesses.
Used methods to DRY up your code. Good use of Enumerables.
Created instance variables & local variables where appropriate. Yes, although not all instance methods seemed necessary.
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. Good use of Faker!
Programmed "defensively" to detect errors in user input. Well done, good defensive programming!
Summary You used a lot of advanced features and accomplished the primary requirements and several extras. Do think a bit about how you organized the program as you read POODR ch 1. Start thinking about where you need objects and where you don't. The only criticism I have is on your program organization. Overall very good work!

end

# Returns word based on theme
def get_theme_word theme

Choose a reason for hiding this comment

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

I like it, a theme!

def update_board letter_guessed
word_split = @word.split("")
# Returns index number of rightly guessed letter
get_word_index = word_split.each_index.select {|index| word_split[index].downcase == letter_guessed}

Choose a reason for hiding this comment

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

Very clever use of Enumerables.

attr_reader :image_type

def initialize image_type
@image_type = image_type

Choose a reason for hiding this comment

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

Why have this instance variable? What purpose does it serve?

def guessed_letter attempts_left
puts "Please pick a letter (a-z). Your attempts_left are #{attempts_left}"
letter = gets.chomp.downcase
until letter =~ /^[a-zA_Z\s]$/

Choose a reason for hiding this comment

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

Good defensive programming, good use of a regex!

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