Skip to content

Commit 945e228

Browse files
authored
Merge pull request #323 from exercism/kytrinyx/inline-insert
Inline the exercise README insert into the exercise template
2 parents aae3eeb + de6b87a commit 945e228

File tree

63 files changed

+279
-275
lines changed

Some content is hidden

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

63 files changed

+279
-275
lines changed

config/exercise_readme.go.tmpl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
{{- with .Hints }}
55
{{ . }}
66
{{ end }}
7-
{{- with .TrackInsert }}
8-
{{ . }}
9-
{{ end }}
10-
{{- with .Spec.Credits -}}
7+
## Setup
8+
9+
Go through the project setup instructions for Xcode using Swift:
10+
11+
http://exercism.io/languages/swift
12+
13+
{{ with .Spec.Credits }}
1114
## Source
1215

1316
{{ . }}

docs/EXERCISE_README_INSERT.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

exercises/accumulate/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ Keep your hands off that collect/map/fmap/whatchamacallit functionality
2525
provided by your standard library!
2626
Solve this one yourself using other basic tools instead.
2727

28-
Lisp specific: it's perfectly fine to use `MAPCAR` or the equivalent,
29-
as this is idiomatic Lisp, not a library function.
30-
3128
## Setup
3229

3330
Go through the project setup instructions for Xcode using Swift:

exercises/acronym/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Techies love their TLA (Three Letter Acronyms)!
77
Help generate some jargon by writing a program that converts a long name
88
like Portable Network Graphics to its acronym (PNG).
99

10-
1110
## Setup
1211

1312
Go through the project setup instructions for Xcode using Swift:

exercises/all-your-base/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Implement general base conversion. Given a number in base **a**,
66
represented as a sequence of digits, convert it to base **b**.
77

88
## Note
9+
910
- Try to implement the conversion yourself.
1011
Do not use something else to perform the conversion for you.
1112

@@ -28,7 +29,6 @@ The number 1120, *in base 3*, means:
2829

2930
I think you got the idea!
3031

31-
3232
*Yes. Those three numbers above are exactly the same. Congratulations!*
3333

3434
## Setup
@@ -38,6 +38,5 @@ Go through the project setup instructions for Xcode using Swift:
3838
http://exercism.io/languages/swift
3939

4040

41-
4241
## Submitting Incomplete Solutions
4342
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/allergies/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ allergens that score 256, 512, 1024, etc.). Your program should
2929
ignore those components of the score. For example, if the allergy
3030
score is 257, your program should only report the eggs (1) allergy.
3131

32-
3332
## Setup
3433

3534
Go through the project setup instructions for Xcode using Swift:

exercises/atbash-cipher/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ letter, the second with the second-last, and so on.
99

1010
An Atbash cipher for the Latin alphabet would be as follows:
1111

12-
```plain
12+
```text
1313
Plain: abcdefghijklmnopqrstuvwxyz
1414
Cipher: zyxwvutsrqponmlkjihgfedcba
1515
```
@@ -23,6 +23,7 @@ being 5 letters, and punctuation is excluded. This is to make it harder to guess
2323
things based on word boundaries.
2424

2525
## Examples
26+
2627
- Encoding `test` gives `gvhg`
2728
- Decoding `gvhg` gives `test`
2829
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`

exercises/beer-song/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Beer Song
22

3-
Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
3+
Recite the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
44

55
Note that not all verses are identical.
66

7-
```plain
7+
```text
88
99 bottles of beer on the wall, 99 bottles of beer.
99
Take one down and pass it around, 98 bottles of beer on the wall.
1010

exercises/binary/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ string, your program should produce a decimal output. The
77
program should handle invalid inputs.
88

99
## Note
10+
1011
- Implement the conversion yourself.
1112
Do not use something else to perform the conversion for you.
1213

1314
## About Binary (Base-2)
15+
1416
Decimal is a base-10 system.
1517

1618
A number 23 in base 10 notation can be understood

exercises/bob/.meta/description.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
2+
3+
Bob answers 'Sure.' if you ask him a question.
4+
5+
He answers 'Whoa, chill out!' if you yell at him.
6+
7+
He says 'Fine. Be that way!' if you address him without actually saying
8+
anything.
9+
10+
He answers 'Whatever.' to anything else.

exercises/bowling/README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,29 @@
22

33
Score a bowling game.
44

5-
Bowling is game where players roll a heavy ball to knock down pins
5+
Bowling is a game where players roll a heavy ball to knock down pins
66
arranged in a triangle. Write code to keep track of the score
77
of a game of bowling.
88

99
## Scoring Bowling
1010

11-
The game consists of 10 frames. A frame is composed of one or two ball throws with 10 pins standing at frame initialization. There are three cases for the tabulation of a frame.
11+
The game consists of 10 frames. A frame is composed of one or two ball
12+
throws with 10 pins standing at frame initialization. There are three
13+
cases for the tabulation of a frame.
1214

13-
* An open frame is where a score of less than 10 is recorded for the frame. In this case the score for the frame is the number of pins knocked down.
15+
* An open frame is where a score of less than 10 is recorded for the
16+
frame. In this case the score for the frame is the number of pins
17+
knocked down.
1418

15-
* A spare is where all ten pins are knocked down after the second throw. The total value of a spare is 10 plus the number of pins knocked down in their next throw.
19+
* A spare is where all ten pins are knocked down by the second
20+
throw. The total value of a spare is 10 plus the number of pins
21+
knocked down in their next throw.
1622

17-
* A strike is where all ten pins are knocked down after the first throw. The total value of a strike is 10 plus the number of pins knocked down in their next two throws. If a strike is immediately followed by a second strike, then we can not total the value of first strike until they throw the ball one more time.
23+
* A strike is where all ten pins are knocked down by the first
24+
throw. The total value of a strike is 10 plus the number of pins
25+
knocked down in the next two throws. If a strike is immediately
26+
followed by a second strike, then the value of the first strike
27+
cannot be determined until the ball is thrown one more time.
1828

1929
Here is a three frame example:
2030

@@ -30,7 +40,11 @@ Frame 3 is (9 + 0) = 9
3040

3141
This means the current running total is 48.
3242

33-
The tenth frame in the game is a special case. If someone throws a strike or a spare then they get a fill ball. Fill balls exist to calculate the total of the 10th frame. Scoring a strike or spare on the fill ball does not give the player more fill balls. The total value of the 10th frame is the total number of pins knocked down.
43+
The tenth frame in the game is a special case. If someone throws a
44+
strike or a spare then they get a fill ball. Fill balls exist to
45+
calculate the total of the 10th frame. Scoring a strike or spare on
46+
the fill ball does not give the player more fill balls. The total
47+
value of the 10th frame is the total number of pins knocked down.
3448

3549
For a tenth frame of X1/ (strike and a spare), the total value is 20.
3650

exercises/circular-buffer/README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,57 @@ uses a single, fixed-size buffer as if it were connected end-to-end.
66
A circular buffer first starts empty and of some predefined length. For
77
example, this is a 7-element buffer:
88

9-
[ ][ ][ ][ ][ ][ ][ ]
9+
[ ][ ][ ][ ][ ][ ][ ]
1010

1111
Assume that a 1 is written into the middle of the buffer (exact starting
1212
location does not matter in a circular buffer):
1313

14-
[ ][ ][ ][1][ ][ ][ ]
14+
[ ][ ][ ][1][ ][ ][ ]
1515

1616
Then assume that two more elements are added — 2 & 3 — which get
1717
appended after the 1:
1818

19-
[ ][ ][ ][1][2][3][ ]
19+
[ ][ ][ ][1][2][3][ ]
2020

2121
If two elements are then removed from the buffer, the oldest values
2222
inside the buffer are removed. The two elements removed, in this case,
2323
are 1 & 2, leaving the buffer with just a 3:
2424

25-
[ ][ ][ ][ ][ ][3][ ]
25+
[ ][ ][ ][ ][ ][3][ ]
2626

2727
If the buffer has 7 elements then it is completely full:
2828

29-
[6][7][8][9][3][4][5]
29+
[6][7][8][9][3][4][5]
3030

3131
When the buffer is full an error will be raised, alerting the client
3232
that further writes are blocked until a slot becomes free.
3333

34-
The client can opt to overwrite the oldest data with a forced write. In
35-
this case, two more elements — A & B — are added and they overwrite the
36-
3 & 4:
34+
When the buffer is full, the client can opt to overwrite the oldest
35+
data with a forced write. In this case, two more elements — A & B —
36+
are added and they overwrite the 3 & 4:
3737

38-
[6][7][8][9][A][B][5]
38+
[6][7][8][9][A][B][5]
3939

40-
Finally, if two elements are now removed then what would be returned is
41-
not 3 & 4 but 5 & 6 because A & B overwrote the 3 & the 4 yielding the
42-
buffer with:
40+
3 & 4 have been replaced by A & B making 5 now the oldest data in the
41+
buffer. Finally, if two elements are removed then what would be
42+
returned is 5 & 6 yielding the buffer:
4343

44-
[ ][7][8][9][A][B][ ]
44+
[ ][7][8][9][A][B][ ]
45+
46+
Because there is space available, if the client again uses overwrite
47+
to store C & D then the space where 5 & 6 were stored previously will
48+
be used not the location of 7 & 8. 7 is still the oldest element and
49+
the buffer is once again full.
50+
51+
[D][7][8][9][A][B][C]
4552

4653
## Setup
4754

4855
Go through the project setup instructions for Xcode using Swift:
4956

5057
http://exercism.io/languages/swift
5158

59+
5260
## Source
5361

5462
Wikipedia [http://en.wikipedia.org/wiki/Circular_buffer](http://en.wikipedia.org/wiki/Circular_buffer)

exercises/collatz-conjecture/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ Go through the project setup instructions for Xcode using Swift:
3232

3333
http://exercism.io/languages/swift
3434

35+
3536
## Source
3637

3738
An unsolved problem in mathematics named after mathematician Lothar Collatz [https://en.wikipedia.org/wiki/3x_%2B_1_problem](https://en.wikipedia.org/wiki/3x_%2B_1_problem)
3839

3940
## Submitting Incomplete Solutions
40-
4141
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/crypto-square/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ and `r` is the number of rows.
2626
Our normalized text is 54 characters long, dictating a rectangle with
2727
`c = 8` and `r = 7`:
2828

29-
```plain
29+
```text
3030
ifmanwas
3131
meanttos
3232
tayonthe
@@ -41,22 +41,24 @@ right.
4141

4242
The message above is coded as:
4343

44-
```plain
44+
```text
4545
imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
4646
```
4747

48-
Output the encoded text in chunks. Phrases that fill perfect squares
49-
`(r X r)` should be output in `r`-length chunks separated by spaces.
50-
Imperfect squares will have `n` empty spaces. Those spaces should be distributed evenly across the last `n` rows.
48+
Output the encoded text in chunks. Phrases that fill perfect rectangles
49+
`(r X c)` should be output `c` chunks of `r` length, separated by spaces.
50+
Phrases that do not fill perfect rectangles will have `n` empty spaces.
51+
Those spaces should be distributed evenly, added to the end of the last
52+
`n` chunks.
5153

52-
```plain
53-
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
54+
```text
55+
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
5456
```
5557

5658
Notice that were we to stack these, we could visually decode the
5759
cyphertext back in to the original message:
5860

59-
```plain
61+
```text
6062
imtgdvs
6163
fearwer
6264
mayoogo

exercises/custom-set/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ Go through the project setup instructions for Xcode using Swift:
1414
http://exercism.io/languages/swift
1515

1616

17-
1817
## Submitting Incomplete Solutions
1918
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/diamond/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Diamond
2+
13
The diamond kata takes as its input a letter, and outputs it in a diamond
24
shape. Given a letter, it prints a diamond starting with 'A', with the
35
supplied letter at the widest point.
@@ -56,6 +58,7 @@ Go through the project setup instructions for Xcode using Swift:
5658

5759
http://exercism.io/languages/swift
5860

61+
5962
## Source
6063

6164
Seb Rose [http://claysnow.co.uk/recycling-tests-in-tdd/](http://claysnow.co.uk/recycling-tests-in-tdd/)

exercises/dominoes/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ correct domino chain (the dots on one half of a stone match the dots on the
77
neighbouring half of an adjacent stone) and that dots on the halfs of the stones
88
which don't have a neighbour (the first and last stone) match each other.
99

10-
For example given the stones `21`, `23` and `13` you should compute something
11-
like `12 23 31` or `32 21 13` or `13 32 21` etc, where the first and last numbers are the same.
10+
For example given the stones `[2|1]`, `[2|3]` and `[1|3]` you should compute something
11+
like `[1|2] [2|3] [3|1]` or `[3|2] [2|1] [1|3]` or `[1|3] [3|2] [2|1]` etc, where the first and last numbers are the same.
1212

13-
For stones 12, 41 and 23 the resulting chain is not valid: 41 12 23's first and last numbers are not the same. 4 != 3
13+
For stones `[1|2]`, `[4|1]` and `[2|3]` the resulting chain is not valid: `[4|1] [1|2] [2|3]`'s first and last numbers are not the same. 4 != 3
1414

1515
Some test cases may use duplicate stones in a chain solution, assume that multiple Domino sets are being used.
1616

@@ -21,6 +21,5 @@ Go through the project setup instructions for Xcode using Swift:
2121
http://exercism.io/languages/swift
2222

2323

24-
2524
## Submitting Incomplete Solutions
2625
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

exercises/etl/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# Etl
1+
# ETL
22

33
We are going to do the `Transform` step of an Extract-Transform-Load.
44

55
### ETL
6+
67
Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
78
we're going to migrate this."
89

@@ -11,6 +12,7 @@ once." That's then typically followed by much forehead slapping and
1112
moaning about how stupid we could possibly be.)
1213

1314
### The goal
15+
1416
We're going to extract some scrabble scores from a legacy system.
1517

1618
The old system stored a list of letters per score:

exercises/flatten-array/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
Take a nested list and return a single flattened list with all values except nil/null.
44

55
The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
6-
6+
77
For Example
88

99
input: [1,[2,3,null,4],[null],5]
1010

1111
output: [1,2,3,4,5]
1212

13-
1413
## Setup
1514

1615
Go through the project setup instructions for Xcode using Swift:

exercises/food-chain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This is a [cumulative song](http://en.wikipedia.org/wiki/Cumulative_song) of unk
1010

1111
This is one of many common variants.
1212

13-
```plain
13+
```text
1414
I know an old lady who swallowed a fly.
1515
I don't know why she swallowed the fly. Perhaps she'll die.
1616

exercises/grade-school/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ In the end, you should be able to:
2121
Note that all our students only have one name. (It's a small town, what
2222
do you want?)
2323

24-
2524
## For bonus points
2625

2726
Did you get the tests passing and the code clean? If you want to, these

0 commit comments

Comments
 (0)