-
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 - Evelynn #33
base: master
Are you sure you want to change the base?
Conversation
Portmanteau GeneratorWhat We're Looking For
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 submission. Keep up the hard work! |
else | ||
letter = false | ||
end | ||
return letter |
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 would probably not store the true
or false
value in letter
, because we would expect letter
to be a one-character string. Instead you could create a new variable (maybe vowel
), or just return from inside the case
statement.
word_A = gets.chomp | ||
until word_A.length >= 2 | ||
puts "I'm sorry, this word is invalid. Please enter a word that is at least 2 characters long." | ||
word_A = 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.
In Ruby, we typically name variables using all lowercases letters, so this would be word_a
.
word_A = gets.chomp | ||
end | ||
word_A_chop = 0 | ||
word_A_last = word_A.length - 1 |
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.
You should use vertical whitespace (empty lines) to separate different pieces of your code, the same way you would use space to separate paragraphs in English text.
Just focusing on the section for the first word, I would probably put a blank line after lines 17, 17, and 33.
word_B = gets.chomp | ||
until word_B.length >= 2 | ||
puts "I'm sorry, this word is invalid. Please enter a word that is at least 2 characters long." | ||
word_B = 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?