Skip to content

Inline the exercise README insert into the exercise template #323

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

Merged
merged 3 commits into from
Feb 5, 2018
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
11 changes: 7 additions & 4 deletions config/exercise_readme.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
{{- with .Hints }}
{{ . }}
{{ end }}
{{- with .TrackInsert }}
{{ . }}
{{ end }}
{{- with .Spec.Credits -}}
## Setup

Go through the project setup instructions for Xcode using Swift:

http://exercism.io/languages/swift

{{ with .Spec.Credits }}
## Source

{{ . }}
Expand Down
6 changes: 0 additions & 6 deletions docs/EXERCISE_README_INSERT.md

This file was deleted.

3 changes: 0 additions & 3 deletions exercises/accumulate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ 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:
Expand Down
1 change: 0 additions & 1 deletion exercises/acronym/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ 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:
Expand Down
3 changes: 1 addition & 2 deletions exercises/all-your-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ 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.

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

I think you got the idea!


*Yes. Those three numbers above are exactly the same. Congratulations!*

## Setup
Expand All @@ -38,6 +38,5 @@ 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.
1 change: 0 additions & 1 deletion exercises/allergies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ 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:
Expand Down
3 changes: 2 additions & 1 deletion exercises/atbash-cipher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ letter, the second with the second-last, and so on.

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

```plain
```text
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: zyxwvutsrqponmlkjihgfedcba
```
Expand All @@ -23,6 +23,7 @@ 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`
Expand Down
4 changes: 2 additions & 2 deletions exercises/beer-song/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Beer Song

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

Note that not all verses are identical.

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

Expand Down
2 changes: 2 additions & 0 deletions exercises/binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ string, your program should produce a decimal output. The
program should handle invalid inputs.

## Note

- Implement the conversion yourself.
Do not use something else to perform the conversion for you.

## About Binary (Base-2)

Decimal is a base-10 system.

A number 23 in base 10 notation can be understood
Expand Down
10 changes: 10 additions & 0 deletions exercises/bob/.meta/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Bob is a lackadaisical teenager. In conversation, his responses are very limited.

Bob answers 'Sure.' if you ask him a question.

He answers 'Whoa, chill out!' if you yell at him.

He says 'Fine. Be that way!' if you address him without actually saying
anything.

He answers 'Whatever.' to anything else.
26 changes: 20 additions & 6 deletions exercises/bowling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@

Score a bowling game.

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

## Scoring Bowling

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.
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.

* 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.
* 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.

* 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.
* A spare is where all ten pins are knocked down by the second
throw. The total value of a spare is 10 plus the number of pins
knocked down in their next throw.

* 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.
* A strike is where all ten pins are knocked down by the first
throw. The total value of a strike is 10 plus the number of pins
knocked down in the next two throws. If a strike is immediately
followed by a second strike, then the value of the first strike
cannot be determined until the ball is thrown one more time.

Here is a three frame example:

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

This means the current running total is 48.

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.
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.

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

Expand Down
34 changes: 21 additions & 13 deletions exercises/circular-buffer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,57 @@ uses a single, fixed-size buffer as if it were connected end-to-end.
A circular buffer first starts empty and of some predefined length. For
example, this is a 7-element buffer:

[ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ]

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

[ ][ ][ ][1][ ][ ][ ]
[ ][ ][ ][1][ ][ ][ ]

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

[ ][ ][ ][1][2][3][ ]
[ ][ ][ ][1][2][3][ ]

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

[ ][ ][ ][ ][ ][3][ ]
[ ][ ][ ][ ][ ][3][ ]

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

[6][7][8][9][3][4][5]
[6][7][8][9][3][4][5]

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

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

[6][7][8][9][A][B][5]
[6][7][8][9][A][B][5]

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

[ ][7][8][9][A][B][ ]
[ ][7][8][9][A][B][ ]

Because there is space available, if the client again uses overwrite
to store C & D then the space where 5 & 6 were stored previously will
be used not the location of 7 & 8. 7 is still the oldest element and
the buffer is once again full.

[D][7][8][9][A][B][C]

## Setup

Go through the project setup instructions for Xcode using Swift:

http://exercism.io/languages/swift


## Source

Wikipedia [http://en.wikipedia.org/wiki/Circular_buffer](http://en.wikipedia.org/wiki/Circular_buffer)
Expand Down
2 changes: 1 addition & 1 deletion exercises/collatz-conjecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Go through the project setup instructions for Xcode using Swift:

http://exercism.io/languages/swift


## Source

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)

## Submitting Incomplete Solutions

It's possible to submit an incomplete solution so you can see how others have completed the exercise.
18 changes: 10 additions & 8 deletions exercises/crypto-square/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and `r` is the number of rows.
Our normalized text is 54 characters long, dictating a rectangle with
`c = 8` and `r = 7`:

```plain
```text
ifmanwas
meanttos
tayonthe
Expand All @@ -41,22 +41,24 @@ right.

The message above is coded as:

```plain
```text
imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
```

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

```plain
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
```text
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
```

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

```plain
```text
imtgdvs
fearwer
mayoogo
Expand Down
1 change: 0 additions & 1 deletion exercises/custom-set/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ 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.
3 changes: 3 additions & 0 deletions exercises/diamond/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Diamond

The diamond kata takes as its input a letter, and outputs it in a diamond
shape. Given a letter, it prints a diamond starting with 'A', with the
supplied letter at the widest point.
Expand Down Expand Up @@ -56,6 +58,7 @@ Go through the project setup instructions for Xcode using Swift:

http://exercism.io/languages/swift


## Source

Seb Rose [http://claysnow.co.uk/recycling-tests-in-tdd/](http://claysnow.co.uk/recycling-tests-in-tdd/)
Expand Down
7 changes: 3 additions & 4 deletions exercises/dominoes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ correct domino chain (the dots on one half of a stone match the dots on the
neighbouring half of an adjacent stone) and that dots on the halfs of the stones
which don't have a neighbour (the first and last stone) match each other.

For example given the stones `21`, `23` and `13` you should compute something
like `12 23 31` or `32 21 13` or `13 32 21` etc, where the first and last numbers are the same.
For example given the stones `[2|1]`, `[2|3]` and `[1|3]` you should compute something
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.

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
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

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

Expand All @@ -21,6 +21,5 @@ 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.
4 changes: 3 additions & 1 deletion exercises/etl/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Etl
# ETL

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

### ETL

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
we're going to migrate this."

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

### The goal

We're going to extract some scrabble scores from a legacy system.

The old system stored a list of letters per score:
Expand Down
3 changes: 1 addition & 2 deletions exercises/flatten-array/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
Take a nested list and return a single flattened list with all values except nil/null.

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.

For Example

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

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


## Setup

Go through the project setup instructions for Xcode using Swift:
Expand Down
2 changes: 1 addition & 1 deletion exercises/food-chain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a [cumulative song](http://en.wikipedia.org/wiki/Cumulative_song) of unk

This is one of many common variants.

```plain
```text
I know an old lady who swallowed a fly.
I don't know why she swallowed the fly. Perhaps she'll die.

Expand Down
1 change: 0 additions & 1 deletion exercises/grade-school/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ In the end, you should be able to:
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
Expand Down
Loading