-
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 - Pauline #46
base: master
Are you sure you want to change the base?
Conversation
Portmanteau GeneratorWhat We're Looking For
|
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.
Great work, my comments are mostly to help you keep growing and analyzing this code!
# Program will repeat until user does not answer "yes" to restart prompt at the end | ||
run = "yes" | ||
loop do | ||
break if run != "yes" |
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.
it would be more succinct (and conventional) to write the above as follows:
while run != "yes" do
# Get first word, with a do while loop to reprompt if input is invalid | ||
puts "What is the first word to combine?" | ||
loop do | ||
word_one = gets.chomp.downcase |
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 job catching capital letters
end | ||
|
||
# Method to find last vowel | ||
def find_last_vowel (word) |
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.
Is there a way you could combine find_first_vowl
and find_last_vowel
?
end | ||
|
||
# Method to create the second word | ||
def create_word_two(word) |
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, is there a way to make these two functions into just one?
|
||
# Prompt to restart | ||
puts "Would you like to continue? (yes / no)" | ||
run = gets.chomp.downcase |
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.
Some programs use y and yes interchangeably for this purpose. How would you accommodate this?
Portmanteau Generator
Congratulations! You're submitting your assignment.
Comprehension Questions
is_vowel?
method affect your project?