Conversation
Solar SystemWhat We're Looking For
You need to fill out the comprehension question answers when you make a pull request Good job on this project, it has everything we expected and runs as expected Good job making and using the You make an instance of SolarSystem named This is a small bug, but if I type "explore" and then put in ANY number, there are some... unexpected consequences. I can type in "-1" or "0" or "234234". (I see that you have a comment that marks that as a TODO) This is just a small observation, but your data you have for Jupiter, Mars, and Venus do not set an initial value Also, I like the interaction "explore" Overall good work |
|
|
||
| # TO DO: Add a check to ensure they've supplied a valid number | ||
|
|
||
| puts planets[gets.chomp.to_i - 1].all_facts |
There was a problem hiding this comment.
the value of planets is the same as outer_space.planets. It would be better if you used that array instead, so it was outer_space.planets[gets.chomp.to_i - 1].all_facts
| print "How far away from the sun is the planet? " | ||
| new_user_planet[:distance_from_sun] = gets.chomp.to_s | ||
|
|
||
| planets << Planet.new(new_user_planet) |
There was a problem hiding this comment.
I mentioned this in my review but I think it'd be great if SolarSystem had this method:
class SolarSystem
...
def add_planet( new_planet )
@planets << new_planet
endand this line was instead
outer_space.add_planet( Planet.new(new_user_planet) )
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initializemethod in your class? The initialize checks for the required inputs or sets the default inputsSolarSystemused anArrayvs aHash. with an array I would not have been able to use keys and values for planet details.