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

Sockets - Kate N #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

KateAnnNichols
Copy link

Portmanteau Generator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What went well in your code style, such as indentation, spacing, variable names, readability, etc.? What was lacking? What went well in my code was indentation, spacing, and using loops and arrays. I was lacking some readability; I think I made this harder for myself than necessary.
How did creating the is_vowel? method affect your project? Creating the 'is_vowel' method affected my project by providing a method to check individual characters against for vowels.
What was your strategy for getting the correct set of letters from the first word into the portmanteau? My strategy for this was to split the first word using an each_char loop. I used is_vowel(letter) to organize the split.
What was your strategy for validating against inputs under 2 characters? My strategy for this was to do a .length < 2 within an if statement.
In the next project, what would you change about your process? What would you keep doing? I would spend more time on pseudocode and work more collaboratively with peers going into it. I would better allocate time to how I work through different parts, and reach out for help after getting stuck for more than 15 mins. I will keep using arrays to simplify things where possible, and keep practicing defining methods and writing returns.

#Note to instructors

I plan to work through parts of the code (emphasis on Wave 2), since it is not yet working at 100%.

@droberts-sea
Copy link

Portmanteau Generator

What We're Looking For

Feature Feedback
Readable code with consistent indentation yes
Practices using variables appropriately yes
Practices using conditionals appropriately yes
Practices iteration appropriately yes
Practices using custom methods appropriately yes
Program validates against input under 2 characters yes
Takes in two inputs and creates a portmanteau some

This is a good start. As you noted, you're missing the final bit of logic from wave 2, but your code is clean and well organized, and it's clear to me that the learning goals around working with methods were met. Keep up the hard work!

def is_vowel?(letter)
if ["a", "e", "i", "o", "u"].include?(letter)
return true
else

Choose a reason for hiding this comment

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

Good use of .include? here to keep this clean.

def find_vowel(word)
part1 = nil
word.each_char do |letter|
if is_vowel?(letter) == true

Choose a reason for hiding this comment

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

I like that you've broken this work out into a separate method - good work!

second = gets.chomp
if second.length < 2
puts "Invalid input. Please enter a word that is at least two characters long."
second = gets.chomp

Choose a reason for hiding this comment

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

Your code to get the second word is almost exactly the same as the code to get the first word. Could you DRY this up using another method?

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