Skip to content

Commit 0a6e716

Browse files
authored
Merge pull request #314 from exercism/generate-readme
Generate exercise READMEs from templates
2 parents aeead67 + 453dfa3 commit 0a6e716

File tree

58 files changed

+3960
-1
lines changed

Some content is hidden

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

58 files changed

+3960
-1
lines changed

docs/EXERCISE_README_INSERT.md renamed to config/exercise-readme-insert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ haven't already, it will help you with organizing your files.
2222

2323
## Feedback, Issues, Pull Requests
2424

25-
The [exercism/xrust](https://github.com/exercism/xrust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
25+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
2626

2727
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
2828

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/acronym/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
## Rust Installation
12+
13+
Refer to the [exercism help page][help-page] for Rust installation and learning
14+
resources.
15+
16+
## Writing the Code
17+
18+
Execute the tests with:
19+
20+
```bash
21+
$ cargo test
22+
```
23+
24+
All but the first test have been ignored. After you get the first test to
25+
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
26+
to pass again. The test file is located in the `tests` directory. You can
27+
also remove the ignore flag from all the tests to get them to run all at once
28+
if you wish.
29+
30+
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
31+
haven't already, it will help you with organizing your files.
32+
33+
## Feedback, Issues, Pull Requests
34+
35+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
36+
37+
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
38+
39+
[help-page]: http://exercism.io/languages/rust
40+
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
41+
42+
## Source
43+
44+
Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc)
45+
46+
## Submitting Incomplete Solutions
47+
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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
## Rust Installation
35+
36+
Refer to the [exercism help page][help-page] for Rust installation and learning
37+
resources.
38+
39+
## Writing the Code
40+
41+
Execute the tests with:
42+
43+
```bash
44+
$ cargo test
45+
```
46+
47+
All but the first test have been ignored. After you get the first test to
48+
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
49+
to pass again. The test file is located in the `tests` directory. You can
50+
also remove the ignore flag from all the tests to get them to run all at once
51+
if you wish.
52+
53+
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
54+
haven't already, it will help you with organizing your files.
55+
56+
## Feedback, Issues, Pull Requests
57+
58+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
59+
60+
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
61+
62+
[help-page]: http://exercism.io/languages/rust
63+
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
64+
65+
66+
## Submitting Incomplete Solutions
67+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/allergies/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
## Rust Installation
34+
35+
Refer to the [exercism help page][help-page] for Rust installation and learning
36+
resources.
37+
38+
## Writing the Code
39+
40+
Execute the tests with:
41+
42+
```bash
43+
$ cargo test
44+
```
45+
46+
All but the first test have been ignored. After you get the first test to
47+
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
48+
to pass again. The test file is located in the `tests` directory. You can
49+
also remove the ignore flag from all the tests to get them to run all at once
50+
if you wish.
51+
52+
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
53+
haven't already, it will help you with organizing your files.
54+
55+
## Feedback, Issues, Pull Requests
56+
57+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
58+
59+
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
60+
61+
[help-page]: http://exercism.io/languages/rust
62+
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
63+
64+
## Source
65+
66+
Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com)
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/alphametics/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Alphametics
2+
3+
Write a function to solve alphametics puzzles.
4+
5+
[Alphametics](https://en.wikipedia.org/wiki/Alphametics) is a puzzle where
6+
letters in words are replaced with numbers.
7+
8+
For example `SEND + MORE = MONEY`:
9+
10+
```
11+
S E N D
12+
M O R E +
13+
-----------
14+
M O N E Y
15+
```
16+
17+
Replacing these with valid numbers gives:
18+
19+
```
20+
9 5 6 7
21+
1 0 8 5 +
22+
-----------
23+
1 0 6 5 2
24+
```
25+
26+
This is correct because every letter is replaced by a different number and the
27+
words, translated into numbers, then make a valid sum.
28+
29+
Each letter must represent a different digit, and the leading digit of
30+
a multi-digit number must not be zero.
31+
32+
Write a function to solve alphametics puzzles.
33+
34+
## Rust Installation
35+
36+
Refer to the [exercism help page][help-page] for Rust installation and learning
37+
resources.
38+
39+
## Writing the Code
40+
41+
Execute the tests with:
42+
43+
```bash
44+
$ cargo test
45+
```
46+
47+
All but the first test have been ignored. After you get the first test to
48+
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
49+
to pass again. The test file is located in the `tests` directory. You can
50+
also remove the ignore flag from all the tests to get them to run all at once
51+
if you wish.
52+
53+
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
54+
haven't already, it will help you with organizing your files.
55+
56+
## Feedback, Issues, Pull Requests
57+
58+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
59+
60+
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
61+
62+
[help-page]: http://exercism.io/languages/rust
63+
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
64+
65+
66+
## Submitting Incomplete Solutions
67+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/anagram/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Anagram
2+
3+
Given a word and a list of possible anagrams, select the correct sublist.
4+
5+
Given `"listen"` and a list of candidates like `"enlists" "google"
6+
"inlets" "banana"` the program should return a list containing
7+
`"inlets"`.
8+
9+
## Rust Installation
10+
11+
Refer to the [exercism help page][help-page] for Rust installation and learning
12+
resources.
13+
14+
## Writing the Code
15+
16+
Execute the tests with:
17+
18+
```bash
19+
$ cargo test
20+
```
21+
22+
All but the first test have been ignored. After you get the first test to
23+
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
24+
to pass again. The test file is located in the `tests` directory. You can
25+
also remove the ignore flag from all the tests to get them to run all at once
26+
if you wish.
27+
28+
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
29+
haven't already, it will help you with organizing your files.
30+
31+
## Feedback, Issues, Pull Requests
32+
33+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
34+
35+
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
36+
37+
[help-page]: http://exercism.io/languages/rust
38+
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
39+
40+
## Source
41+
42+
Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup)
43+
44+
## Submitting Incomplete Solutions
45+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/atbash-cipher/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Atbash Cipher
2+
3+
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
4+
5+
The Atbash cipher is a simple substitution cipher that relies on
6+
transposing all the letters in the alphabet such that the resulting
7+
alphabet is backwards. The first letter is replaced with the last
8+
letter, the second with the second-last, and so on.
9+
10+
An Atbash cipher for the Latin alphabet would be as follows:
11+
12+
```plain
13+
Plain: abcdefghijklmnopqrstuvwxyz
14+
Cipher: zyxwvutsrqponmlkjihgfedcba
15+
```
16+
17+
It is a very weak cipher because it only has one possible key, and it is
18+
a simple monoalphabetic substitution cipher. However, this may not have
19+
been an issue in the cipher's time.
20+
21+
Ciphertext is written out in groups of fixed length, the traditional group size
22+
being 5 letters, and punctuation is excluded. This is to make it harder to guess
23+
things based on word boundaries.
24+
25+
## Examples
26+
- Encoding `test` gives `gvhg`
27+
- Decoding `gvhg` gives `test`
28+
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`
29+
30+
## Rust Installation
31+
32+
Refer to the [exercism help page][help-page] for Rust installation and learning
33+
resources.
34+
35+
## Writing the Code
36+
37+
Execute the tests with:
38+
39+
```bash
40+
$ cargo test
41+
```
42+
43+
All but the first test have been ignored. After you get the first test to
44+
pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
45+
to pass again. The test file is located in the `tests` directory. You can
46+
also remove the ignore flag from all the tests to get them to run all at once
47+
if you wish.
48+
49+
Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
50+
haven't already, it will help you with organizing your files.
51+
52+
## Feedback, Issues, Pull Requests
53+
54+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
55+
56+
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
57+
58+
[help-page]: http://exercism.io/languages/rust
59+
[crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
60+
61+
## Source
62+
63+
Wikipedia [http://en.wikipedia.org/wiki/Atbash](http://en.wikipedia.org/wiki/Atbash)
64+
65+
## Submitting Incomplete Solutions
66+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

0 commit comments

Comments
 (0)