-
Notifications
You must be signed in to change notification settings - Fork 648
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
Logan Anderson #442
base: master
Are you sure you want to change the base?
Logan Anderson #442
Conversation
"Trying to fix error message when pushing"
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.
Logan, overall great work on this. Good job getting into extensions too!
if frog == 1 | ||
puts "#{frog} speckled frog sat on a log eating some most delicious bugs. One jumped in the pool where its nice and cool, then there were no more speckled frogs!" | ||
elsif frog == 2 | ||
puts "#{frog} speckled frogs sat on a log eating some most delicious bugs. One jumped in the pool where its nice and cool, then there was #{frog - 1} speckled frog." | ||
else | ||
puts "#{frog} speckled frogs sat on a log eating some most delicious bugs. One jumped in the pool where its nice and cool, then there were #{frog - 1} speckled frogs." |
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.
Nice work catching the different cases. Refactor consideration: How might you DRY up the repeated phrases in here?
if number % 3 == 0 && number % 5 == 0 && number == ending_num | ||
print "FizzBuzz " | ||
elsif number % 3 == 0 && number == ending_num | ||
print "Fizz " | ||
elsif number % 5 == 0 && number == ending_num | ||
print "Buzz " | ||
elsif number == ending_num | ||
print "#{number} " | ||
elsif number % 3 == 0 && number % 5 == 0 && !(number == ending_num) | ||
print "FizzBuzz, " | ||
elsif number % 3 == 0 && !(number == ending_num) | ||
print "Fizz, " | ||
elsif number % 5 == 0 && !(number == ending_num) | ||
print "Buzz, " | ||
else | ||
print "#{number}, " |
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.
This large conditional is ripe for refactoring.
def add_topping(new_topping) | ||
toppings << new_topping | ||
end | ||
|
||
def remove_topping(bad_topping) | ||
toppings.delete(bad_topping) | ||
end | ||
|
||
def change_protein(new_protein) | ||
@protein = new_protein | ||
end |
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.
Nice work modifying the class attributes
Mod 1 Pre-work.