Skip to content

Conversation

@saltedseacorn
Copy link

Here is my prework!

Copy link

@ap2322 ap2322 left a comment

Choose a reason for hiding this comment

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

Kon, Great work on this! I left some high level notes on where you could think about refactoring your code.

frogs -= 1
puts "then there were #{frogs} speckled frogs."
end
if frogs === 1
Copy link

Choose a reason for hiding this comment

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

Question for you to research: What's the difference in Ruby between =, ==, and ===?

Comment on lines +15 to +20
if high % 15 === 0
print "FizzBuzz"
elsif high % 5 === 0
print "Buzz"
elsif high % 3 === 0
print "Fizz"
Copy link

Choose a reason for hiding this comment

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

Seems like these lines are repeated from inside your while loop. This is a good candidate to refactor so you don't have repeating conditionals with the same output.

Comment on lines +9 to +11
Let's make a function that will take two parameters: the string that the user wants to encrypt, and the number of degrees we will shift our alphabet to the left.

`def caesar_cipher(string, degrees)`
Copy link

Choose a reason for hiding this comment

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

Nice work making a clear step-by-step document with some code snippets to illustrate the explanation of how you'll go about making a caesar cipher.

Comment on lines +17 to +27
def add_topping(topping)
toppings.push(topping)
end

def remove_topping(topping)
toppings.delete(topping)
end

def change_protein(protein)
self.protein = protein
end
Copy link

Choose a reason for hiding this comment

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

Another way of updating the attributes directly is to use the instance variable @protein (or @toppings).

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