-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add my solution to both problems #121
base: master
Are you sure you want to change the base?
Conversation
@@ -1,13 +1,34 @@ | |||
def get_letter_grade(integer) | |||
|
|||
#Put your code here! | |||
if integer >= 90 then |
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.
Awesome work! There are some styling things going on here so I wanted to link the style guide for reference: https://github.com/rubocop-hq/ruby-style-guide
Using '
single tick quotes when you aren't interpolating.
Don't need to explicitlty call return
to return values, ruby will evaluate the last line of the method as is and return it.
Functionality wise here this work but does it seem like it's starting to get a little lengthy? If you have a hunch you are correct, check out case statements and also you can have the final catch in your if/elsif/else
be an else
instead of the return outside of the if
statement
letsdrill.rb
Outdated
shortest = array[0] | ||
|
||
array.each { |item| | ||
if item.length < shortest.length then |
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.
Pretty creative way to solve it! You do not need the then
here.
letsdrill.rb
Outdated
|
||
shortest = array[0] | ||
|
||
array.each { |item| |
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's preferred to use the do/end
syntax for multiline blocks
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.
Thanks for all the tips! I swapped out all the styling stuff like you mentioned 👍
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.
Looks great, change up some styling and you have a nice solution on your hands
No description provided.