-
Notifications
You must be signed in to change notification settings - Fork 50
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
base: master
Are you sure you want to change the base?
Sockets - Kate N #39
Conversation
Portmanteau GeneratorWhat We're Looking For
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
Portmanteau Generator
Congratulations! You're submitting your assignment.
Comprehension Questions
is_vowel?
method affect your project?#Note to instructors
I plan to work through parts of the code (emphasis on Wave 2), since it is not yet working at 100%.