Add my solution to both problems#121
Add my solution to both problems#121JeffMorhous wants to merge 5 commits intopaircolumbus:masterfrom
Conversation
| def get_letter_grade(integer) | ||
|
|
||
| #Put your code here! | ||
| if integer >= 90 then |
There was a problem hiding this comment.
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.
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.
It's preferred to use the do/end syntax for multiline blocks
There was a problem hiding this comment.
Thanks for all the tips! I swapped out all the styling stuff like you mentioned 👍
djlax805
left a comment
There was a problem hiding this comment.
Looks great, change up some styling and you have a nice solution on your hands
No description provided.