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 - Karla Guadron #50

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Sockets - Karla Guadron #50

wants to merge 4 commits into from

Conversation

kguadron
Copy link

@kguadron kguadron commented Feb 9, 2019

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? Styling, keeping track of indentations, and separating code into chunks that made sense went well. I am improving at giving my variable more suitable and descriptive names. I struggled with mapping the indexes and identifying the range of the indices for the letters I wanted to submit.
How did creating the is_vowel? method affect your project? It helped with iterating through each letter in the user's words in order to identify which indices to use to determine the chunk of the word that would be added to the portmanteau. It also proved to be handy for the condition that checked if the word had no vowels at all.
What was your strategy for getting the correct set of letters from the first word into the portmanteau? My strategy was to create a new first word variable and an index variable and to iterate through the letters in the first word in reverse order. I subtracted 1 from the index variable (which was set to the total length of the word - 1) for every iteration where the letter wasn't a vowel. When the letter was a variable, the value of the index variable was used as the ending point in the range of the index that identified which letters from the first word would be assigned to the new first word which was then used in the portmanteau.
What was your strategy for validating against inputs under 2 characters? I used an until loop that continued to prompt the user to input a word until the length of their word was at least 2 characters long.
In the next project, what will you change about your process? What will you keep doing? I will ask for help sooner! I will continue to collaborate with peers!

@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 submission. Keep up the hard work!

def is_vowel?(letter)
if letter =~ /[aeiou]/
return true
elsif letter !~ /[aeiou]/

Choose a reason for hiding this comment

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

Nice use of a regular expression here! We'll talk about those more formally in a few weeks.

puts "What is the second word?"
word_two = gets.chomp
until word_two.length >= 2
puts "Your word must have at least 2 characters. Please enter something else"

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?

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