-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
118 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# Instructions | ||
|
||
Given students' names along with the grade that they are in, create a roster for the school. | ||
Given students' names along with the grade they are in, create a roster for the school. | ||
|
||
In the end, you should be able to: | ||
|
||
- Add a student's name to the roster for a grade | ||
- Add a student's name to the roster for a grade: | ||
- "Add Jim to grade 2." | ||
- "OK." | ||
- Get a list of all students enrolled in a grade | ||
- Get a list of all students enrolled in a grade: | ||
- "Which students are in grade 2?" | ||
- "We've only got Jim just now." | ||
- "We've only got Jim right now." | ||
- Get a sorted list of all students in all grades. | ||
Grades should sort as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name. | ||
- "Who all is enrolled in school right now?" | ||
Grades should be sorted as 1, 2, 3, etc., and students within a grade should be sorted alphabetically by name. | ||
- "Who is enrolled in school right now?" | ||
- "Let me think. | ||
We have Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2 and Jim in grade 5. | ||
So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe and Jim" | ||
We have Anna, Barb, and Charlie in grade 1, Alex, Peter, and Zoe in grade 2, and Jim in grade 5. | ||
So the answer is: Anna, Barb, Charlie, Alex, Peter, Zoe, and Jim." | ||
|
||
Note that all our students only have one name (It's a small town, what do you want?) and each student cannot be added more than once to a grade or the roster. | ||
In fact, when a test attempts to add the same student more than once, your implementation should indicate that this is incorrect. | ||
Note that all our students only have one name (it's a small town, what do you want?), and each student cannot be added more than once to a grade or the roster. | ||
If a test attempts to add the same student more than once, your implementation should indicate that this is incorrect. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Introduction | ||
|
||
Your body is made up of cells that contain DNA. | ||
Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells. | ||
In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime! | ||
|
||
When cells divide, their DNA replicates too. | ||
Sometimes during this process mistakes happen and single pieces of DNA get encoded with the incorrect information. | ||
If we compare two strands of DNA and count the differences between them, we can see how many mistakes occurred. | ||
This is known as the "Hamming distance". | ||
|
||
The Hamming distance is useful in many areas of science, not just biology, so it's a nice phrase to be familiar with :) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
# Instructions | ||
|
||
Given an age in seconds, calculate how old someone would be on: | ||
Given an age in seconds, calculate how old someone would be on a planet in our Solar System. | ||
|
||
- Mercury: orbital period 0.2408467 Earth years | ||
- Venus: orbital period 0.61519726 Earth years | ||
- Earth: orbital period 1.0 Earth years, 365.25 Earth days, or 31557600 seconds | ||
- Mars: orbital period 1.8808158 Earth years | ||
- Jupiter: orbital period 11.862615 Earth years | ||
- Saturn: orbital period 29.447498 Earth years | ||
- Uranus: orbital period 84.016846 Earth years | ||
- Neptune: orbital period 164.79132 Earth years | ||
One Earth year equals 365.25 Earth days, or 31,557,600 seconds. | ||
If you were told someone was 1,000,000,000 seconds old, their age would be 31.69 Earth-years. | ||
|
||
So if you were told someone were 1,000,000,000 seconds old, you should | ||
be able to say that they're 31.69 Earth-years old. | ||
For the other planets, you have to account for their orbital period in Earth Years: | ||
|
||
If you're wondering why Pluto didn't make the cut, go watch [this YouTube video][pluto-video]. | ||
| Planet | Orbital period in Earth Years | | ||
| ------- | ----------------------------- | | ||
| Mercury | 0.2408467 | | ||
| Venus | 0.61519726 | | ||
| Earth | 1.0 | | ||
| Mars | 1.8808158 | | ||
| Jupiter | 11.862615 | | ||
| Saturn | 29.447498 | | ||
| Uranus | 84.016846 | | ||
| Neptune | 164.79132 | | ||
|
||
Note: The actual length of one complete orbit of the Earth around the sun is closer to 365.256 days (1 sidereal year). | ||
~~~~exercism/note | ||
The actual length of one complete orbit of the Earth around the sun is closer to 365.256 days (1 sidereal year). | ||
The Gregorian calendar has, on average, 365.2425 days. | ||
While not entirely accurate, 365.25 is the value used in this exercise. | ||
See [Year on Wikipedia][year] for more ways to measure a year. | ||
[pluto-video]: https://www.youtube.com/watch?v=Z_2gbGXzFbs | ||
[year]: https://en.wikipedia.org/wiki/Year#Summary | ||
~~~~ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Introduction | ||
|
||
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). | ||
The first stop is Mercury, where customs require you to fill out a form (bureaucracy is apparently _not_ Earth-specific). | ||
As you hand over the form to the customs officer, they scrutinize it and frown. | ||
"Do you _really_ expect me to believe you're just 50 years old? | ||
You must be closer to 200 years old!" | ||
|
||
Amused, you wait for the customs officer to start laughing, but they appear to be dead serious. | ||
You realize that you've entered your age in _Earth years_, but the officer expected it in _Mercury years_! | ||
As Mercury's orbital period around the sun is significantly shorter than Earth, you're actually a lot older in Mercury years. | ||
After some quick calculations, you're able to provide your age in Mercury Years. | ||
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. | ||
|
||
~~~~exercism/note | ||
If you're wondering why Pluto didn't make the cut, go watch [this YouTube video][pluto-video]. | ||
[pluto-video]: https://www.youtube.com/watch?v=Z_2gbGXzFbs | ||
~~~~ |
This file contains 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
This file contains 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
This file contains 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