-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate static exercise README templates (#287)
* Add default exercise readme template * Generate static exercise README templates We are working towards making exercises stand-alone. That is to say: no more generating READMEs on the fly. This will give maintainers more control over each individual exercise README, and it will also make some of the backend logic for delivering exercises simpler. The README template uses the Go text/template package, and the default templates generate the same READMEs as we have been generating on the fly. See the documentation in [regenerating exercise readmes][regenerate-docs] for details. The READMEs can be generated at any time using a new 'generate' command in configlet. This command has not yet landed in master or been released, but can be built from source in the generate-readmes branch on [configlet][]. [configlet]: https://github.com/exercism/configlet [regenerate-docs]: https://github.com/exercism/docs/blob/master/maintaining-a-track/regenerating-exercise-readmes.md
- Loading branch information
Showing
76 changed files
with
3,555 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# {{ .Spec.Name }} | ||
|
||
{{ .Spec.Description -}} | ||
{{- with .Hints }} | ||
{{ . }} | ||
{{ end }} | ||
{{- with .TrackInsert }} | ||
{{ . }} | ||
{{ end }} | ||
{{- with .Spec.Credits -}} | ||
## Source | ||
|
||
{{ . }} | ||
{{ end }} | ||
## Submitting Incomplete Solutions | ||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
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,43 @@ | ||
# Accumulate | ||
|
||
Implement the `accumulate` operation, which, given a collection and an | ||
operation to perform on each element of the collection, returns a new | ||
collection containing the result of applying that operation to each element of | ||
the input collection. | ||
|
||
Given the collection of numbers: | ||
|
||
- 1, 2, 3, 4, 5 | ||
|
||
And the operation: | ||
|
||
- square a number (`x => x * x`) | ||
|
||
Your code should be able to produce the collection of squares: | ||
|
||
- 1, 4, 9, 16, 25 | ||
|
||
Check out the test suite to see the expected function signature. | ||
|
||
## Restrictions | ||
|
||
Keep your hands off that collect/map/fmap/whatchamacallit functionality | ||
provided by your standard library! | ||
Solve this one yourself using other basic tools instead. | ||
|
||
Lisp specific: it's perfectly fine to use `MAPCAR` or the equivalent, | ||
as this is idiomatic Lisp, not a library function. | ||
|
||
## Setup | ||
|
||
Go through the project setup instructions for Xcode using Swift: | ||
|
||
http://exercism.io/languages/swift | ||
|
||
|
||
## Source | ||
|
||
Conversation with James Edward Gray II [https://twitter.com/jeg2](https://twitter.com/jeg2) | ||
|
||
## Submitting Incomplete Solutions | ||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
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,23 @@ | ||
# Acronym | ||
|
||
Convert a phrase to its acronym. | ||
|
||
Techies love their TLA (Three Letter Acronyms)! | ||
|
||
Help generate some jargon by writing a program that converts a long name | ||
like Portable Network Graphics to its acronym (PNG). | ||
|
||
|
||
## Setup | ||
|
||
Go through the project setup instructions for Xcode using Swift: | ||
|
||
http://exercism.io/languages/swift | ||
|
||
|
||
## Source | ||
|
||
Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc) | ||
|
||
## Submitting Incomplete Solutions | ||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
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,43 @@ | ||
# All Your Base | ||
|
||
Convert a number, represented as a sequence of digits in one base, to any other base. | ||
|
||
Implement general base conversion. Given a number in base **a**, | ||
represented as a sequence of digits, convert it to base **b**. | ||
|
||
## Note | ||
- Try to implement the conversion yourself. | ||
Do not use something else to perform the conversion for you. | ||
|
||
## About [Positional Notation](https://en.wikipedia.org/wiki/Positional_notation) | ||
|
||
In positional notation, a number in base **b** can be understood as a linear | ||
combination of powers of **b**. | ||
|
||
The number 42, *in base 10*, means: | ||
|
||
(4 * 10^1) + (2 * 10^0) | ||
|
||
The number 101010, *in base 2*, means: | ||
|
||
(1 * 2^5) + (0 * 2^4) + (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (0 * 2^0) | ||
|
||
The number 1120, *in base 3*, means: | ||
|
||
(1 * 3^3) + (1 * 3^2) + (2 * 3^1) + (0 * 3^0) | ||
|
||
I think you got the idea! | ||
|
||
|
||
*Yes. Those three numbers above are exactly the same. Congratulations!* | ||
|
||
## Setup | ||
|
||
Go through the project setup instructions for Xcode using Swift: | ||
|
||
http://exercism.io/languages/swift | ||
|
||
|
||
|
||
## Submitting Incomplete Solutions | ||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
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,45 @@ | ||
# Allergies | ||
|
||
Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies. | ||
|
||
An allergy test produces a single numeric score which contains the | ||
information about all the allergies the person has (that they were | ||
tested for). | ||
|
||
The list of items (and their value) that were tested are: | ||
|
||
* eggs (1) | ||
* peanuts (2) | ||
* shellfish (4) | ||
* strawberries (8) | ||
* tomatoes (16) | ||
* chocolate (32) | ||
* pollen (64) | ||
* cats (128) | ||
|
||
So if Tom is allergic to peanuts and chocolate, he gets a score of 34. | ||
|
||
Now, given just that score of 34, your program should be able to say: | ||
|
||
- Whether Tom is allergic to any one of those allergens listed above. | ||
- All the allergens Tom is allergic to. | ||
|
||
Note: a given score may include allergens **not** listed above (i.e. | ||
allergens that score 256, 512, 1024, etc.). Your program should | ||
ignore those components of the score. For example, if the allergy | ||
score is 257, your program should only report the eggs (1) allergy. | ||
|
||
|
||
## Setup | ||
|
||
Go through the project setup instructions for Xcode using Swift: | ||
|
||
http://exercism.io/languages/swift | ||
|
||
|
||
## Source | ||
|
||
Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com) | ||
|
||
## Submitting Incomplete Solutions | ||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
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,21 @@ | ||
# Anagram | ||
|
||
Given a word and a list of possible anagrams, select the correct sublist. | ||
|
||
Given `"listen"` and a list of candidates like `"enlists" "google" | ||
"inlets" "banana"` the program should return a list containing | ||
`"inlets"`. | ||
|
||
## Setup | ||
|
||
Go through the project setup instructions for Xcode using Swift: | ||
|
||
http://exercism.io/languages/swift | ||
|
||
|
||
## Source | ||
|
||
Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup) | ||
|
||
## Submitting Incomplete Solutions | ||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
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,42 @@ | ||
# Atbash Cipher | ||
|
||
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East. | ||
|
||
The Atbash cipher is a simple substitution cipher that relies on | ||
transposing all the letters in the alphabet such that the resulting | ||
alphabet is backwards. The first letter is replaced with the last | ||
letter, the second with the second-last, and so on. | ||
|
||
An Atbash cipher for the Latin alphabet would be as follows: | ||
|
||
```plain | ||
Plain: abcdefghijklmnopqrstuvwxyz | ||
Cipher: zyxwvutsrqponmlkjihgfedcba | ||
``` | ||
|
||
It is a very weak cipher because it only has one possible key, and it is | ||
a simple monoalphabetic substitution cipher. However, this may not have | ||
been an issue in the cipher's time. | ||
|
||
Ciphertext is written out in groups of fixed length, the traditional group size | ||
being 5 letters, and punctuation is excluded. This is to make it harder to guess | ||
things based on word boundaries. | ||
|
||
## Examples | ||
- Encoding `test` gives `gvhg` | ||
- Decoding `gvhg` gives `test` | ||
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog` | ||
|
||
## Setup | ||
|
||
Go through the project setup instructions for Xcode using Swift: | ||
|
||
http://exercism.io/languages/swift | ||
|
||
|
||
## Source | ||
|
||
Wikipedia [http://en.wikipedia.org/wiki/Atbash](http://en.wikipedia.org/wiki/Atbash) | ||
|
||
## Submitting Incomplete Solutions | ||
It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
Oops, something went wrong.