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

Ports - Kim Fasbender #26

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

Conversation

Kimberly-Fasbender
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 think indentation, spacing, and readability went well. I think I could use some work on variable names, and making my code more efficient/DRY.
How did creating the is_vowel? method affect your project? It made my code cleaner, and made checking if a character was a vowel much more efficient.
What was your strategy for getting the correct set of letters from the first word into the portmanteau? I used the reverse and each_char methods to iterate through the characters of the first word, starting at the last letter and working towards the front letter. I then checked each letter using the is_vowel? method to check if the letter was a vowel. If it wasn't a vowel it added a -1 to a counter variable (count). Then I printed the word to the console by using an index of 0 to the number of consonants minus one (to account for getting rid of the last vowel as well).
What was your strategy for validating against inputs under 2 characters? I created a method that printed an error message and another prompt for user input if the input was less than 2 letters. I then ran it after prompting for user input.
In the next project, what would you change about your process? What would you keep doing? I would definitely be more open to admitting I am struggling and ask for help sooner. I would keep taking deep breaths and reminding myself that I'm not a quitter and that things will get done.

@CheezItMan
Copy link

Portmanteau Generator

What We're Looking For

Feature Feedback
Readable code with consistent indentation Check
Practices using variables appropriately Check
Practices using conditionals appropriately Check
Practices iteration appropriately Check
Practices using custom methods appropriately Check, nice creation of custom methods, it made run_generator very small and concise.
Program validates against input under 2 characters Check
Takes in two inputs and creates a portmanteau Check

Summary | Great work! You hit all the learning goals and the program works well.


# method that checks whether a letter is a vowel or not
def is_vowel?(letter)
if ["a", "e", "i", "o", "u"].include?(letter)

Choose a reason for hiding this comment

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

Since .include? returns true or false you could simplify this with:

return ["a", "e", "i", "o", "u"].include?(letter)


# method that returns user input after verifying that is at least 2
# letters in length
def input

Choose a reason for hiding this comment

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

Nice work breaking user input into a a separate reusable 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