Conversation
Solar SystemWhat We're Looking For
|
| end | ||
|
|
||
| def user_compare_planets(solarsystem, planet1, planet2) | ||
| planet1_position = solarsystem.find_planet(planet1) |
There was a problem hiding this comment.
very small observation: your code doesn't check if the input name is a valid choice before you call solarsystem.find_planet :P
|
Good code! You show a great understanding of how to pass objects/values as arguments to other methods, and using those arguments. The code is well done. Regarding your answers to the comprehension questions: Your solar system does not take in an array of hashes, it (appropriately) takes in an array of By the way, using the shortcut to align indentations in code is exactly what it's meant to be used for! :) |
| @@ -0,0 +1,198 @@ | |||
| #PLANETS | |||
| class Planets | |||
There was a problem hiding this comment.
small note: You may want to rename your classes so that they are always singular, as they represent a single Planet in this case.
| puts planet_rotational_age(canaansworld, canaansworld.age, planet_choice) | ||
|
|
||
| elsif answer == "exit" | ||
| puts "Well, ttyl then, nerd" |
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initializemethod in your class?SolarSystemused anArrayvs aHash.