-
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 - Maria #45
base: master
Are you sure you want to change the base?
Sockets - Maria #45
Conversation
Please refer to the last update, thank you 👍 |
Portmanteau GeneratorWhat We're Looking For
|
@@ -0,0 +1,29 @@ | |||
def get_the_vowel(word) | |||
word.length > 1 && word =~ /[aeiou]/ |
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.
Very fancy! Could use a comment though!
end | ||
|
||
words = [] | ||
a = first_word.rindex(/[aeiou].*/) |
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.
again, would love a comment on this part. Most programmers don't choose to solve problems with regular expressions because they are hard to read on their own even if they are very efficient.
until get_the_vowel(second_word) | ||
puts "Please enter a word with 2 or more characters and a vowel" | ||
second_word = gets.chomp.downcase | ||
end |
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.
So the indentation is conventionally done like this:
second_word = gets.chomp.downcase
until get_the_vowel(second_word)
puts "Please enter a word with 2 or more characters and a vowel"
second_word = gets.chomp.downcase
end
words << word_b | ||
|
||
puts "Word #{word_a} + #{word_b} is #{words.join("")}" | ||
|
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.
Read our instructions carefully! We asked for a run_generator
method that you didn't include!
Portmanteau Generator
Congratulations! You're submitting your assignment.
Comprehension Questions
is_vowel?
method affect your project?