Skip to content

Commit 27c3a5c

Browse files
authored
Merge pull request #574 from exercism/generate-readme
Generate exercise READMEs from templates
2 parents e637303 + 1018f58 commit 27c3a5c

File tree

83 files changed

+8161
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+8161
-0
lines changed

config/exercise_readme.go.tmpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# {{ .Spec.Name }}
2+
3+
{{ .Spec.Description -}}
4+
{{- with .Hints }}
5+
{{ . }}
6+
{{ end }}
7+
{{- with .TrackInsert }}
8+
{{ . }}
9+
{{ end }}
10+
{{- with .Spec.Credits -}}
11+
## Source
12+
13+
{{ . }}
14+
{{ end }}
15+
## Submitting Incomplete Solutions
16+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/accumulate/README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Accumulate
2+
3+
Implement the `accumulate` operation, which, given a collection and an
4+
operation to perform on each element of the collection, returns a new
5+
collection containing the result of applying that operation to each element of
6+
the input collection.
7+
8+
Given the collection of numbers:
9+
10+
- 1, 2, 3, 4, 5
11+
12+
And the operation:
13+
14+
- square a number (`x => x * x`)
15+
16+
Your code should be able to produce the collection of squares:
17+
18+
- 1, 4, 9, 16, 25
19+
20+
Check out the test suite to see the expected function signature.
21+
22+
## Restrictions
23+
24+
Keep your hands off that collect/map/fmap/whatchamacallit functionality
25+
provided by your standard library!
26+
Solve this one yourself using other basic tools instead.
27+
28+
Lisp specific: it's perfectly fine to use `MAPCAR` or the equivalent,
29+
as this is idiomatic Lisp, not a library function.
30+
31+
32+
## Getting Started
33+
34+
For installation and learning resources, refer to the
35+
[exercism help page](http://exercism.io/languages/haskell).
36+
37+
## Running the tests
38+
39+
To run the test suite, execute the following command:
40+
41+
```bash
42+
stack test
43+
```
44+
45+
#### If you get an error message like this...
46+
47+
```
48+
No .cabal file found in directory
49+
```
50+
51+
You are probably running an old stack version and need
52+
to upgrade it.
53+
54+
#### Otherwise, if you get an error message like this...
55+
56+
```
57+
No compiler found, expected minor version match with...
58+
Try running "stack setup" to install the correct GHC...
59+
```
60+
61+
Just do as it says and it will download and install
62+
the correct compiler version:
63+
64+
```bash
65+
stack setup
66+
```
67+
68+
## Running *GHCi*
69+
70+
If you want to play with your solution in GHCi, just run the command:
71+
72+
```bash
73+
stack ghci
74+
```
75+
76+
## Feedback, Issues, Pull Requests
77+
78+
The [exercism/haskell](https://github.com/exercism/haskell) repository on
79+
GitHub is the home for all of the Haskell exercises.
80+
81+
If you have feedback about an exercise, or want to help implementing a new
82+
one, head over there and create an issue. We'll do our best to help you!
83+
84+
## Source
85+
86+
Conversation with James Edward Gray II [https://twitter.com/jeg2](https://twitter.com/jeg2)
87+
88+
## Submitting Incomplete Solutions
89+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/acronym/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Acronym
2+
3+
Convert a phrase to its acronym.
4+
5+
Techies love their TLA (Three Letter Acronyms)!
6+
7+
Help generate some jargon by writing a program that converts a long name
8+
like Portable Network Graphics to its acronym (PNG).
9+
10+
11+
12+
## Getting Started
13+
14+
For installation and learning resources, refer to the
15+
[exercism help page](http://exercism.io/languages/haskell).
16+
17+
## Running the tests
18+
19+
To run the test suite, execute the following command:
20+
21+
```bash
22+
stack test
23+
```
24+
25+
#### If you get an error message like this...
26+
27+
```
28+
No .cabal file found in directory
29+
```
30+
31+
You are probably running an old stack version and need
32+
to upgrade it.
33+
34+
#### Otherwise, if you get an error message like this...
35+
36+
```
37+
No compiler found, expected minor version match with...
38+
Try running "stack setup" to install the correct GHC...
39+
```
40+
41+
Just do as it says and it will download and install
42+
the correct compiler version:
43+
44+
```bash
45+
stack setup
46+
```
47+
48+
## Running *GHCi*
49+
50+
If you want to play with your solution in GHCi, just run the command:
51+
52+
```bash
53+
stack ghci
54+
```
55+
56+
## Feedback, Issues, Pull Requests
57+
58+
The [exercism/haskell](https://github.com/exercism/haskell) repository on
59+
GitHub is the home for all of the Haskell exercises.
60+
61+
If you have feedback about an exercise, or want to help implementing a new
62+
one, head over there and create an issue. We'll do our best to help you!
63+
64+
## Source
65+
66+
Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc)
67+
68+
## Submitting Incomplete Solutions
69+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/all-your-base/README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# All Your Base
2+
3+
Convert a number, represented as a sequence of digits in one base, to any other base.
4+
5+
Implement general base conversion. Given a number in base **a**,
6+
represented as a sequence of digits, convert it to base **b**.
7+
8+
## Note
9+
- Try to implement the conversion yourself.
10+
Do not use something else to perform the conversion for you.
11+
12+
## About [Positional Notation](https://en.wikipedia.org/wiki/Positional_notation)
13+
14+
In positional notation, a number in base **b** can be understood as a linear
15+
combination of powers of **b**.
16+
17+
The number 42, *in base 10*, means:
18+
19+
(4 * 10^1) + (2 * 10^0)
20+
21+
The number 101010, *in base 2*, means:
22+
23+
(1 * 2^5) + (0 * 2^4) + (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (0 * 2^0)
24+
25+
The number 1120, *in base 3*, means:
26+
27+
(1 * 3^3) + (1 * 3^2) + (2 * 3^1) + (0 * 3^0)
28+
29+
I think you got the idea!
30+
31+
32+
*Yes. Those three numbers above are exactly the same. Congratulations!*
33+
34+
35+
## Getting Started
36+
37+
For installation and learning resources, refer to the
38+
[exercism help page](http://exercism.io/languages/haskell).
39+
40+
## Running the tests
41+
42+
To run the test suite, execute the following command:
43+
44+
```bash
45+
stack test
46+
```
47+
48+
#### If you get an error message like this...
49+
50+
```
51+
No .cabal file found in directory
52+
```
53+
54+
You are probably running an old stack version and need
55+
to upgrade it.
56+
57+
#### Otherwise, if you get an error message like this...
58+
59+
```
60+
No compiler found, expected minor version match with...
61+
Try running "stack setup" to install the correct GHC...
62+
```
63+
64+
Just do as it says and it will download and install
65+
the correct compiler version:
66+
67+
```bash
68+
stack setup
69+
```
70+
71+
## Running *GHCi*
72+
73+
If you want to play with your solution in GHCi, just run the command:
74+
75+
```bash
76+
stack ghci
77+
```
78+
79+
## Feedback, Issues, Pull Requests
80+
81+
The [exercism/haskell](https://github.com/exercism/haskell) repository on
82+
GitHub is the home for all of the Haskell exercises.
83+
84+
If you have feedback about an exercise, or want to help implementing a new
85+
one, head over there and create an issue. We'll do our best to help you!
86+
87+
88+
## Submitting Incomplete Solutions
89+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/allergies/README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Allergies
2+
3+
Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.
4+
5+
An allergy test produces a single numeric score which contains the
6+
information about all the allergies the person has (that they were
7+
tested for).
8+
9+
The list of items (and their value) that were tested are:
10+
11+
* eggs (1)
12+
* peanuts (2)
13+
* shellfish (4)
14+
* strawberries (8)
15+
* tomatoes (16)
16+
* chocolate (32)
17+
* pollen (64)
18+
* cats (128)
19+
20+
So if Tom is allergic to peanuts and chocolate, he gets a score of 34.
21+
22+
Now, given just that score of 34, your program should be able to say:
23+
24+
- Whether Tom is allergic to any one of those allergens listed above.
25+
- All the allergens Tom is allergic to.
26+
27+
Note: a given score may include allergens **not** listed above (i.e.
28+
allergens that score 256, 512, 1024, etc.). Your program should
29+
ignore those components of the score. For example, if the allergy
30+
score is 257, your program should only report the eggs (1) allergy.
31+
32+
33+
## Hints
34+
35+
To complete this exercise you need to to create the data type `Allergen`,
36+
with `Eq` and `Show` instances, and implement the following functions:
37+
38+
- `allergies`
39+
- `isAllergicTo`
40+
41+
You will find a dummy data declaration and type signatures already in place,
42+
but it is up to you to define the functions and create a meaningful data type,
43+
newtype or type synonym.
44+
45+
46+
47+
## Getting Started
48+
49+
For installation and learning resources, refer to the
50+
[exercism help page](http://exercism.io/languages/haskell).
51+
52+
## Running the tests
53+
54+
To run the test suite, execute the following command:
55+
56+
```bash
57+
stack test
58+
```
59+
60+
#### If you get an error message like this...
61+
62+
```
63+
No .cabal file found in directory
64+
```
65+
66+
You are probably running an old stack version and need
67+
to upgrade it.
68+
69+
#### Otherwise, if you get an error message like this...
70+
71+
```
72+
No compiler found, expected minor version match with...
73+
Try running "stack setup" to install the correct GHC...
74+
```
75+
76+
Just do as it says and it will download and install
77+
the correct compiler version:
78+
79+
```bash
80+
stack setup
81+
```
82+
83+
## Running *GHCi*
84+
85+
If you want to play with your solution in GHCi, just run the command:
86+
87+
```bash
88+
stack ghci
89+
```
90+
91+
## Feedback, Issues, Pull Requests
92+
93+
The [exercism/haskell](https://github.com/exercism/haskell) repository on
94+
GitHub is the home for all of the Haskell exercises.
95+
96+
If you have feedback about an exercise, or want to help implementing a new
97+
one, head over there and create an issue. We'll do our best to help you!
98+
99+
## Source
100+
101+
Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com)
102+
103+
## Submitting Incomplete Solutions
104+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

0 commit comments

Comments
 (0)