Taryn Orlemann#69
Conversation
corneliusellen
left a comment
There was a problem hiding this comment.
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.
| puts "hello" === "Hello" | ||
| # 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.
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 |
|
|
||
| else | ||
| puts "You stumble around and fall on a knife and die. Good job!" | ||
| end |
There was a problem hiding this comment.
Did you run this code to make sure it works? Just checking :)
| cups_of_flour = 1 | ||
| has_sauce = true | ||
|
|
||
| if cups_of_flour >= 2 && has_sauce == true |
There was a problem hiding this comment.
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} |
|
|
||
| 8. What questions do you still have about hashes? No newline at end of file | ||
| 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.
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?