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

Word-Guess - Kiera & Hannah - Octos #23

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

Conversation

Krashaune
Copy link

@Krashaune Krashaune commented Feb 14, 2018

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 we did a great job.
For each partner what parts of the project did you find challenging? Kiera: I found that material that I did not fully understand was a barrier to effectively using classes and meeting the project requirements. I also found it challenging to talk through ideas that I had not fully processed myself. Hannah: I found it challenging to both think about what we needed to do and also talk about it at the same time, especially given how tenuous my grasp is on the material.
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? In the explore_classes file, we used a method to print out an array of “” according to the random word length. We also used a method to generate our random word, which takes a sample from an array of words. this input is the constant WORD_POOL and the output is the random word.
Describe an instance where you used a local variable instead of an instance variable. Why did you make that choice? I think we used a local variable when setting the word_template since using the instance variable didn't let us generate it
What code, if any, did you feel like you were duplicating more than necessary? I don’t think we duplicated anything except the picture we used 5 separate pictures instead of changing one photo multiple times. I can't think of anything else off the top of my head without looking at the code
Is there a specific piece of code you'd like feedback on? I'd like to know how far off we were on the "exploring.." version. I feel like we were super close! As well as how we (I/Kiera) can become comfortable with using classes and instance variables.

@droberts-sea
Copy link

Word-Guess Game

What We're Looking For

Feature Feedback
Baseline
Regular Commits with meaningful commit messages. some - I like how descriptive your commit messages are, but would like to see more frequent commits
Readable code with consistent indentation. yes
Answered comprehension questions yes
Product Functionalities
Created a Class to encapsulate game functionality. in progress
Used methods to DRY up your code. yes - good work
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. no - I was able to enter "foo"and "#$^%" both as "valid" guesses

This is an interesting submission. Your class-less version of the program certainly works, but I'm not sure it addresses the learning goals.

For working on the classy version, one thing that I often find helpful is thinking about how my class will be used. For this project, that might mean starting by writing some (rough) driver code, something like:

game = Game.new
while !game.is_over?
  game.print_state
  puts "Letter please"
  letter = gets.chomp
  game.guess_letter(letter)
end

Let me know if you'd like some more guidance or feedback on this. Make sure to spend some time focusing on classes for the Grocery Store project, and keep up the hard work!

when 0
print picture_5
when 1
print picture_4

Choose a reason for hiding this comment

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

Instead of this big case statement, could you put the different images into an array?

check_guess(split_word, guess, word_template)
if word_template.include?("_") == false
puts "Congratulations - you win!!"
exit

Choose a reason for hiding this comment

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

On line 197, .include? will already return a boolean value, so you don't need a separate comparison to false. Either of

if !word_template.include?("_")
# or
unless word_template.include?("_")

would suffice.

def initalize
@random_word = get_random_word
@word_template = word_template
@split_word = split_word

Choose a reason for hiding this comment

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

This seems like it's on the right track. In addition to the word to guess and the array of letters and underscores, you'll need to keep track of what letters have been guessed so far, and how many lives the player has left.

I do like that you've split some of the initialization work out into separate methods.

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