Skip to content

Conversation

@vertige
Copy link

@vertige vertige commented Aug 16, 2017

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What was the purpose of the initialize method in your class? In both classes, initialize creates a new instance object of the class.
Describe an instance variable you used and what you used it for. class Planet had @name as an instance variable that allowed me to call up a name for each instance of Planet I had created when desired.
Describe what the difference would be if your SolarSystem used an Array vs a Hash. My SolarSystem did use an array... I am not sure I understand this question the way you intend :( I could hasve used a hash instead of a class, but then I would have had no class methods. I probably could have created general methods instead... I'm just not sure I even managed this assignment as intended, honestly.
Do you feel like you used consistent indentation throughout your code? Oh! Hopefully!. I generally find it easiest to maintain them while I'm working and use the auto-indent features of Atom when things get hairy. I may not have auto indented right before saving and committing this pull request. I am having trouble knowing how many line spaces I can leave between things to keep things organized when my eyes go over code. It would be nice to figure out ways to use comments or something else, to help section off parts of code for scrollability.

Misleading instructions, later clarified in class, that created a lot of confusion about Wave 1.
end

def rel_age
return (SolarSystem::AGE - @earth_age.to_i) * Planet::EARTH_YEAR / @earth_days.to_f
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small bug: input to @earth_days doesn't check if this is a number or not. If it's not a number, .to_f makes it 0, which divides by zero.

@tildeee
Copy link

tildeee commented Aug 22, 2017

Solar System

What We're Looking For

Feature Feedback
Created Custom Class with initialize method & instance variables. x
Used an Array to store a list of planets in the SolarSystem class. x
Readable code with consistent indentation. x
Created a pull request with your name & the template questions answered. x

@tildeee
Copy link

tildeee commented Aug 22, 2017

Great code. Good use of constants, which we haven't learned about yet! Overall good work.

regarding your questions about organization with code: now that we've learned how to use require_relative and we'll soon learn about modules/namespaces, hopefully those tools will let you organize your code better in the future.

valid = true
puts this_system.planets[i].prettify
print "\nPick another planet "
selection = user_prompt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small refactor: You might be able to move the line selection = user_prompt to the end of the until loop to reduce code repetition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants