-
Notifications
You must be signed in to change notification settings - Fork 48
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
Katrina - Edges - Solar System #28
base: master
Are you sure you want to change the base?
Conversation
…om outside the class, not writable
…e planet's description
…ith a constructor
Solar SystemWhat We're Looking For
Good work on this project! The code looks good, the overall project looks good -- the code is readable, clean, and hits all the requirements. I think you put a lot of attention to detail in this project, especially with considering things like Also, great job with handling exceptions! I'm making a few comments on one bug that I see, but otherwise the project looks great, great job! |
end | ||
list = solar_system.list_planets | ||
|
||
if user_input == 'A' |
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.
Instead of checking what user_input
is equal to with a bunch of if
/elsif
/else
clauses, what else could we do?
first_user_planet_found = solar_system.find_planet_by_name(user_first_planet) | ||
second_user_planet_found = solar_system.find_planet_by_name(user_second_planet) | ||
|
||
if first_user_planet_found && second_user_planet_found |
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.
Handling the idea of "what if a planet isn't found" wasn't a requirement, so I usually don't comment on this, but here you are deliberately checking to see if the planets were found so I wanted to chime in...
Your SolarSystem#find_planet_by_name
method actually will never return nil
! Therefore, this line of code if first_user_planet_found && second_user_planet_found
will never be found. Instead, if your method find_planet_by_name
doesn't find a planet, it will return the @planets
array.
# Welcome message to user | ||
def welcome_message | ||
puts "=" * 80 | ||
puts "\t\t\tHello and Welcome to THE MAGIC SCHOOL BUS!" |
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.
🚌
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initialize
method run? What does it do?Hash
instead of an instance of a class?.new
to create a new instance of a planet.SolarSystem
class used aHash
instead of anArray
to store the list of planets?require
statements? Which files neededrequire
s, and which did not? What is the pattern?