-
Notifications
You must be signed in to change notification settings - Fork 66
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
Taryn Orlemann #69
base: main
Are you sure you want to change the base?
Taryn Orlemann #69
Conversation
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 on this @torlemann. I can tell you have a solid understanding of Ruby syntax, datatypes, and conventions. Please see my comments and I would encourage you to adjust anything that should be fixed.
# YOU DO: print to the terminal the result of 3 is not equal to 4: | ||
|
||
puts 3 =/ 4 |
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.
Have you tried running this line (either by executing the file or in irb?) This is not the correct Ruby way to say '3 does not equal 4'
#are less than cars. Since the first statment is not true, it moves on to eval the | ||
#next statement, which is also put true. So it moves on to the else condition and | ||
#prints that. | ||
if cars > people || trucks < cars |
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.
👏
|
||
else | ||
puts "You stumble around and fall on a knife and die. Good job!" | ||
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.
Did you run this code to make sure it works? Just checking :)
@@ -63,3 +66,9 @@ | |||
|
|||
cups_of_flour = 1 | |||
has_sauce = true | |||
|
|||
if cups_of_flour >= 2 && has_sauce == true |
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.
Improvement item - This line is the same thing as if cups_of_flour >= 2 && has_sauce
- and this is more concise!
|
||
# Write code that prints a hash holding zoo animal inventory: | ||
zoo = #YOUR CODE HERE | ||
p zoo | ||
zoo = {leopards: 1, chimpanzees: 5, rhinoceros: 2, bears: 3} |
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 use of this hash syntax
8. What questions do you still have about hashes? | ||
i would like to see more real world examples |
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.
Here's a 'real world' example - you could imagine this existing in a class enrollment system:
students = {
taryn: ["Math", "English", "Computer Science"],
ellen: ["Computer Science", "English", "Art"]
}
I am only now realizing where to enter commit messages for files edited remotely, so my histories for certain files might only say "Update filename.md" or something to that effect, whatever github's default message is, for anything I updated through github. I now know to change that for future commits committed remotely. There are some others however, like a commit message that is just "numbers.rb" that I am not sure how I didn't set the message - could I have committed a git in my terminal without a message inadvertently?