Skip to content
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

[v3] Update Practice Exercises to latest spec #132

Merged
merged 5 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"slug": "hello-world",
"name": "Hello World",
"uuid": "83c215e6-4a4e-4302-8d68-47f367478d2c",
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -32,6 +33,7 @@
"slug": "bob",
"name": "Bob",
"uuid": "e80b254a-0dd8-4efb-83e4-cee1cfc9431e",
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -43,6 +45,7 @@
"slug": "sum-of-multiples",
"name": "Sum Of Multiples",
"uuid": "df4403d1-3fb2-4c2c-a228-2bdb442d0680",
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -55,6 +58,7 @@
"slug": "raindrops",
"name": "Raindrops",
"uuid": "90a12652-946c-4771-83bd-741f884cd426",
"practices": [],
"prerequisites": [],
"difficulty": 2,
"topics": [
Expand All @@ -66,6 +70,7 @@
"slug": "nucleotide-count",
"name": "Nucleotide Count",
"uuid": "68b0b096-c6c0-493f-9f7f-081a413d7078",
"practices": [],
"prerequisites": [],
"difficulty": 2,
"topics": [
Expand All @@ -77,6 +82,7 @@
"slug": "hamming",
"name": "Hamming",
"uuid": "f55b2158-a8f0-4593-b44a-6e750ebac0a5",
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -88,6 +94,7 @@
"slug": "leap",
"name": "Leap",
"uuid": "e62edbd6-861b-4cd6-bb03-6c9bcaa742a4",
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -99,6 +106,7 @@
"slug": "reverse-string",
"name": "Reverse String",
"uuid": "925e73f0-28a9-4e33-937b-5f328ac50163",
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -109,6 +117,7 @@
"slug": "two-fer",
"name": "Two Fer",
"uuid": "45f285c2-9358-451d-a931-1dee54df7b67",
"practices": [],
"prerequisites": [],
"difficulty": 1,
"topics": [
Expand All @@ -120,6 +129,7 @@
"slug": "grade-school",
"name": "Grade School",
"uuid": "2daa9e3e-65c1-4fc3-b6ee-6f477a198fec",
"practices": [],
"prerequisites": [],
"difficulty": 2,
"topics": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Bob
# Instructions

Bob is a lackadaisical teenager. In conversation, his responses are very limited.

Bob answers 'Sure.' if you ask him a question.
Bob answers 'Sure.' if you ask him a question, such as "How are you?".

He answers 'Whoa, chill out!' if you yell at him.
He answers 'Whoa, chill out!' if you YELL AT HIM (in all capitals).

He answers 'Calm down, I know what I'm doing!' if you yell a question at him.

Expand All @@ -14,9 +14,3 @@ anything.
He answers 'Whatever.' to anything else.

Bob's conversational partner is a purist when it comes to written communication and always follows normal rules regarding sentence punctuation in English.
## Source

Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
10 changes: 10 additions & 0 deletions exercises/practice/bob/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial.",
"source_url": "http://pine.fm/LearnToProgram/?Chapter=06"
}
38 changes: 38 additions & 0 deletions exercises/practice/grade-school/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Instructions

Given students' names along with the grade that 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 Jim to grade 2."
- "OK."
- Get a list of all students enrolled in a grade
- "Which students are in grade 2?"
- "We've only got Jim just 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?"
- "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"

Note that all our students only have one name. (It's a small town, what
do you want?)

## For bonus points

Did you get the tests passing and the code clean? If you want to, these
are some additional things you could try:

- If you're working in a language with mutable data structures and your
implementation allows outside code to mutate the school's internal DB
directly, see if you can prevent this. Feel free to introduce additional
tests.

Then please share your thoughts in a comment on the submission. Did this
experiment make the code better? Worse? Did you learn anything from it?
10 changes: 10 additions & 0 deletions exercises/practice/grade-school/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "A pairing session with Phil Battos at gSchool",
"source_url": "http://gschool.it"
}
25 changes: 0 additions & 25 deletions exercises/practice/grade-school/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hamming
# Instructions

Calculate the Hamming Distance between two DNA strands.

Expand All @@ -22,9 +22,3 @@ The Hamming distance is only defined for sequences of equal length, so
an attempt to calculate it between sequences of different lengths should
not work. The general handling of this situation (e.g., raising an
exception vs returning a special value) may differ between languages.
## Source

The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
10 changes: 10 additions & 0 deletions exercises/practice/hamming/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "The Calculating Point Mutations problem at Rosalind",
"source_url": "http://rosalind.info/problems/hamm/"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hello World
# Instructions

The classical introductory exercise. Just say "Hello, World!".

Expand All @@ -13,9 +13,3 @@ The objectives are simple:
- Submit your solution and check it at the website.

If everything goes well, you will be ready to fetch your first real exercise.
## Source

This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
10 changes: 10 additions & 0 deletions exercises/practice/hello-world/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "This is an exercise to introduce users to using Exercism",
"source_url": "http://en.wikipedia.org/wiki/%22Hello,_world!%22_program"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Leap
# Instructions

Given a year, report if it is a leap year.

Expand All @@ -13,9 +13,6 @@ on every year that is evenly divisible by 4
For example, 1997 is not a leap year, but 1996 is. 1900 is not a leap
year, but 2000 is.

If your language provides a method in the standard library that does
this look-up, pretend it doesn't exist and implement it yourself.

## Notes

Though our exercise adopts some very simple rules, there is more to
Expand All @@ -25,9 +22,3 @@ For a delightful, four minute explanation of the whole leap year
phenomenon, go watch [this youtube video][video].

[video]: http://www.youtube.com/watch?v=xX96xng7sAE
## Source

JavaRanch Cattle Drive, exercise 3 [http://www.javaranch.com/leap.jsp](http://www.javaranch.com/leap.jsp)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
10 changes: 10 additions & 0 deletions exercises/practice/leap/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "JavaRanch Cattle Drive, exercise 3",
"source_url": "http://www.javaranch.com/leap.jsp"
}
21 changes: 21 additions & 0 deletions exercises/practice/nucleotide-count/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Instructions

Each of us inherits from our biological parents a set of chemical instructions known as DNA that influence how our bodies are constructed. All known life depends on DNA!

> Note: You do not need to understand anything about nucleotides or DNA to complete this exercise.

DNA is a long chain of other chemicals and the most important are the four nucleotides, adenine, cytosine, guanine and thymine. A single DNA chain can contain billions of these four nucleotides and the order in which they occur is important!
We call the order of these nucleotides in a bit of DNA a "DNA sequence".

We represent a DNA sequence as an ordered collection of these four nucleotides and a common way to do that is with a string of characters such as "ATTACG" for a DNA sequence of 6 nucleotides.
'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' for thymine.

Given a string representing a DNA sequence, count how many of each nucleotide is present.
If the string contains characters that aren't A, C, G, or T then it is invalid and you should signal an error.

For example:

```
"GATTACA" -> 'A': 3, 'C': 1, 'G': 1, 'T': 2
"INVALID" -> error
```
10 changes: 10 additions & 0 deletions exercises/practice/nucleotide-count/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "The Calculating DNA Nucleotides_problem at Rosalind",
"source_url": "http://rosalind.info/problems/dna/"
}
19 changes: 0 additions & 19 deletions exercises/practice/nucleotide-count/README.md

This file was deleted.

16 changes: 16 additions & 0 deletions exercises/practice/raindrops/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Instructions

Your task is to convert a number into a string that contains raindrop sounds corresponding to certain potential factors. A factor is a number that evenly divides into another number, leaving no remainder. The simplest way to test if a one number is a factor of another is to use the [modulo operation](https://en.wikipedia.org/wiki/Modulo_operation).

The rules of `raindrops` are that if a given number:

- has 3 as a factor, add 'Pling' to the result.
- has 5 as a factor, add 'Plang' to the result.
- has 7 as a factor, add 'Plong' to the result.
- _does not_ have any of 3, 5, or 7 as a factor, the result should be the digits of the number.

## Examples

- 28 has 7 as a factor, but not 3 or 5, so the result would be "Plong".
- 30 has both 3 and 5 as factors, but not 7, so the result would be "PlingPlang".
- 34 is not factored by 3, 5, or 7, so the result would be "34".
10 changes: 10 additions & 0 deletions exercises/practice/raindrops/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"authors": [],
"files": {
"solution": [],
"test": [],
"example": []
},
"source": "A variation on FizzBuzz, a famous technical interview question that is intended to weed out potential candidates. That question is itself derived from Fizz Buzz, a popular children's game for teaching division.",
"source_url": "https://en.wikipedia.org/wiki/Fizz_buzz"
}
24 changes: 0 additions & 24 deletions exercises/practice/raindrops/README.md

This file was deleted.

7 changes: 7 additions & 0 deletions exercises/practice/reverse-string/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Instructions

Reverse a string

For example:
input: "cool"
output: "looc"
Loading