Open
Conversation
Misleading instructions, later clarified in class, that created a lot of confusion about Wave 1.
tildeee
reviewed
Aug 22, 2017
| end | ||
|
|
||
| def rel_age | ||
| return (SolarSystem::AGE - @earth_age.to_i) * Planet::EARTH_YEAR / @earth_days.to_f |
There was a problem hiding this comment.
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.
Solar SystemWhat We're Looking For
|
|
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 |
tildeee
reviewed
Aug 22, 2017
| valid = true | ||
| puts this_system.planets[i].prettify | ||
| print "\nPick another planet " | ||
| selection = user_prompt |
There was a problem hiding this comment.
small refactor: You might be able to move the line selection = user_prompt to the end of the until loop to reduce code repetition!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solar System
Congratulations! You're submitting your assignment.
Comprehension Questions
initializemethod in your class?class Planethad@nameas an instance variable that allowed me to call up a name for each instance of Planet I had created when desired.SolarSystemused anArrayvs aHash.SolarSystemdid 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.