Skip to content

Commit 1f079ab

Browse files
space-age: split into instructions and introduction
1 parent 1020f7f commit 1f079ab

File tree

3 files changed

+47
-25
lines changed

3 files changed

+47
-25
lines changed

exercises/space-age/description.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

exercises/space-age/instructions.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Instructions
2+
3+
Given an age in seconds, calculate how old someone would be on a planet in our Solar System.
4+
5+
One Earth year equals 365.25 Earth days, or 31,557,600 seconds.
6+
If you were told someone was 1,000,000,000 seconds old, their age would be 31.69 Earth-years.
7+
8+
For the other planets, you have to account for their orbital period in Earth Years:
9+
10+
| Planet | Orbital period in Earth Years |
11+
| ------- | ----------------------------- |
12+
| Mercury | 0.2408467 |
13+
| Venus | 0.61519726 |
14+
| Earth | 1.0 |
15+
| Mars | 1.8808158 |
16+
| Jupiter | 11.862615 |
17+
| Saturn | 29.447498 |
18+
| Uranus | 84.016846 |
19+
| Neptune | 164.79132 |
20+
21+
~~~~exercism/note
22+
The actual length of one complete orbit of the Earth around the sun is closer to 365.256 days (1 sidereal year).
23+
The Gregorian calendar has, on average, 365.2425 days.
24+
While not entirely accurate, 365.25 is the value used in this exercise.
25+
See [Year on Wikipedia][year] for more ways to measure a year.
26+
27+
[year]: https://en.wikipedia.org/wiki/Year#Summary
28+
~~~~

exercises/space-age/introduction.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Introduction
2+
3+
The year is 2525 and you've just embarked on a journey to visit all planets in the Solar System (Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune).
4+
The first stop is Mercury, where customs require you to fill out a form (bureaucracy is apparently _not_ Earth-specific).
5+
As you hand over the form to the customs officer, they scrutinize it and frown.
6+
"Do you _really_ expect me to believe you're just 50 years old?
7+
You must be closer to 200 years old!"
8+
9+
Amused, you wait for the customs officer to start laughing, but they appear to be dead serious.
10+
You realize that you've entered your age in _Earth years_, but the officer expected it in _Mercury years_!
11+
As Mercury's orbital period around the sun is significantly shorter than Earth, you're actually a lot older in Mercury years.
12+
After some quick calculations, you're able to provide your age in Mercury Years.
13+
The customs officer smiles, satisfied, and waves you through. You make a mental note to pre-calculate your planet-specific age _before_ future customs checks, to avoid such mix-ups.
14+
15+
~~~~exercism/note
16+
If you're wondering why Pluto didn't make the cut, go watch [this YouTube video][pluto-video].
17+
18+
[pluto-video]: https://www.youtube.com/watch?v=Z_2gbGXzFbs
19+
~~~~

0 commit comments

Comments
 (0)