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 - Carla #31

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

Sockets - Carla #31

wants to merge 1 commit into from

Conversation

carlabosco
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? I believe I was careful with the format, but please let me know where I could improve. My code was initially doing an unnecessary loop, but Devin already gave me feedback on it and I updated my code.
How did creating the is_vowel? method affect your project? That was very helpful in making my code less verbose, as I could just reuse this method when needed.
What was your strategy for getting the correct set of letters from the first word into the portmanteau? I iterated the word starting from the last character until the first vowel was found. At this point, the code would break out of the loop and set the new word segment from the first character index until the index of the last vowel, excluding the last vowel.
What was your strategy for validating against inputs under 2 characters? I created an if statement to count the number of vowels in the word. If no vowels are found, the code jumps to the else statement where the string manipulation is made.
In the next project, what would you change about your process? What would you keep doing? I would definitely make better use of pseudo code. I would also make use of "puts" early on to help me debug quicker.

@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 yes

Great job overall! I've left a few comments inline below where things could be cleaned up, but in general I am quite happy with this project. Keep up the hard work!

word_B = gets.chomp
until word_B.size >= 2
puts "Your word should have at least 2 letters."
word_B = 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?

# Check if character is a vowel
def is_vowel? (letter)
if VOWELS.include? (letter)
true

Choose a reason for hiding this comment

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

Good use of a constant and of .include? here.

word_A = gets.chomp
until word_A.size >= 2
puts "Your word should have at least 2 letters."
word_A = gets.chomp

Choose a reason for hiding this comment

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

In Ruby, we typically name variables using all lowercases letters, so this would be word_a.

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