-
Notifications
You must be signed in to change notification settings - Fork 49
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
Daniela Sanchez - Leaves #30
base: master
Are you sure you want to change the base?
Conversation
Solar SystemWhat We're Looking For
|
end | ||
|
||
valid_input = false | ||
until valid_input |
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.
So, the idea of the control loop here is to let the user do one action, and then another, and then another, until they choose the exit option. If we only do the first action they take, we can't see the wonderful planets that they add.
def find_planet_by_name(planet_name) | ||
i=0 | ||
@planets.each do |planet| | ||
if planet.name == planet_name |
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.
our instructions were looking for the match to be case irrelevant, ie "earth" should match with "EaRTH". How could you achieve this?
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?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?