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 - Jansen #44

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

Sockets - Jansen #44

wants to merge 3 commits into from

Conversation

JansenMartin
Copy link

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? I tried to make my variable names descriptive, so it would be easier to walk through my code with someone else the next day (and hopefully, so it would be easier for someone else to parse through it later). As for what's lacking, I'm still not confident in my spacing and indentation. (Sometimes VS Code eliminates my spacing automatically, so I might be using too much space in my code to start with.)
How did creating the is_vowel? method affect your project? Calling the is_vowel? method in my loops made it much easier to evaluate whether any given letter was a value. Since all that code used for checking was contained in that one method, it meant my run_generator method wasn't as cluttered as it would have been otherwise.
What was your strategy for getting the correct set of letters from the first word into the portmanteau? At first, I basically tried using the chomp method to remove any characters I didn't want. However, Shubha pointed out that chomp eliminates ALL instances of that letter in the word (which would lead to some undesirable behavior). When she suggested making index numbers a pivotal part of my solution, I used 1) each_char, 2) an iterator and 3) a conditional statement to capture the last vowel's position in the string. Then, I used the slice method to remove unwanted characters based on the vowel's position.
What was your strategy for validating against inputs under 2 characters? I used an until loop that didn't break until user input was at least 2 characters.
In the next project, what would you change about your process? What would you keep doing? It was definitely valuable talking to my classmates about their code. Before that, I was overthinking everything (and my code didn't work how I wanted it to). I wish I had talked with people earlier in the process, instead of later.

@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 like that you're working with methods beyond what was asked in the project requirements. Your indentation and variable names look good to me. Keep up the hard work!

# Method that collects user input. If input is less than 2 characters, the user must try again.
def ask(prompt)
print "#{prompt} "
input = gets.chomp.downcase

Choose a reason for hiding this comment

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

I love that this is its own method - this makes the code below much easier to understand.

VOWELS = ["a", "e", "i", "o", "u"]

def is_vowel?(letter)
if VOWELS.include?(letter)

Choose a reason for hiding this comment

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

Good use of a constant.

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