Skip to content
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
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).


## Rust Installation

Refer to the [exercism help page][help-page] for Rust installation and learning
Expand Down
2 changes: 1 addition & 1 deletion 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!*

## Rust Installation
Expand Down
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.


## Rust Installation

Refer to the [exercism help page][help-page] for Rust installation and learning
Expand Down
4 changes: 2 additions & 2 deletions exercises/alphametics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ letters in words are replaced with numbers.

For example `SEND + MORE = MONEY`:

```
```text
S E N D
M O R E +
-----------
Expand All @@ -16,7 +16,7 @@ M O N E Y

Replacing these with valid numbers gives:

```
```text
9 5 6 7
1 0 8 5 +
-----------
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
2 changes: 1 addition & 1 deletion exercises/beer-song/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles

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
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
19 changes: 13 additions & 6 deletions exercises/circular-buffer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,25 @@ If the buffer has 7 elements then it is completely full:
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]

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

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]

## Rust Installation

Refer to the [exercism help page][help-page] for Rust installation and learning
Expand Down
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
2 changes: 2 additions & 0 deletions exercises/etl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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
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
1 change: 0 additions & 1 deletion exercises/grains/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Write code that shows:
- how many grains were on each square, and
- the total number of grains


## For bonus points

Did you get the tests passing and the code clean? If you want to, these
Expand Down
2 changes: 1 addition & 1 deletion exercises/leap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Given a year, report if it is a leap year.

The tricky thing here is that a leap year in the Gregorian calendar occurs:

```plain
```text
on every year that is evenly divisible by 4
except every year that is evenly divisible by 100
unless the year is also evenly divisible by 400
Expand Down
14 changes: 7 additions & 7 deletions exercises/luhn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,47 @@ are disallowed.

## Example 1: valid credit card number

```
```text
4539 1488 0343 6467
```

The first step of the Luhn algorithm is to double every second digit,
starting from the right. We will be doubling

```
```text
4_3_ 1_8_ 0_4_ 6_6_
```

If doubling the number results in a number greater than 9 then subtract 9
from the product. The results of our doubling:

```
```text
8569 2478 0383 3437
```

Then sum all of the digits:

```
```text
8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
```

If the sum is evenly divisible by 10, then the number is valid. This number is valid!

## Example 2: invalid credit card number

```
```text
8273 1232 7352 0569
```

Double the second digits, starting from the right

```
```text
7253 2262 5312 0539
```

Sum the digits

```
```text
7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
```

Expand Down
30 changes: 8 additions & 22 deletions exercises/nucleotide-count/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
# Nucleotide Count

Given a DNA string, compute how many times each nucleotide occurs in the string.
Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.

DNA is represented by an alphabet of the following symbols: 'A', 'C',
'G', and 'T'.

Each symbol represents a nucleotide, which is a fancy name for the
particular molecules that happen to make up a large part of DNA.

Shortest intro to biochemistry EVAR:
The genetic language of every living thing on the planet is DNA.
DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides.
4 types exist in DNA and these differ only slightly and can be represented as the following symbols: 'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' thymine.

Here is an analogy:
- twigs are to birds nests as
- nucleotides are to DNA and RNA as
- amino acids are to proteins as
- sugar is to starch as
- oh crap lipids

I'm not going to talk about lipids because they're crazy complex.

So back to nucleotides.

DNA contains four types of them: adenine (`A`), cytosine (`C`), guanine
(`G`), and thymine (`T`).

RNA contains a slightly different set of nucleotides, but we don't care
about that for now.
- nucleotides are to DNA as
- legos are to lego houses as
- words are to sentences as...

## Rust Installation

Expand Down
10 changes: 5 additions & 5 deletions exercises/ocr-numbers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To begin with, convert a simple binary font to a string containing 0 or 1.

The binary font uses pipes and underscores, four rows high and three columns wide.

```
```text
_ #
| | # zero.
|_| #
Expand All @@ -18,7 +18,7 @@ The binary font uses pipes and underscores, four rows high and three columns wid

Is converted to "0"

```
```text
#
| # one.
| #
Expand All @@ -39,7 +39,7 @@ Update your program to recognize multi-character binary strings, replacing garbl

Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.

```
```text
_
_|
|_
Expand All @@ -48,7 +48,7 @@ Update your program to recognize all numbers 0 through 9, both individually and

Is converted to "2"

```
```text
_ _ _ _ _ _ _ _ #
| _| _||_||_ |_ ||_||_|| | # decimal numbers.
||_ _| | _||_| ||_| _||_| #
Expand All @@ -61,7 +61,7 @@ Is converted to "1234567890"

Update your program to handle multiple numbers, one per line. When converting several lines, join the lines with commas.

```
```text
_ _
| _| _|
||_ _|
Expand Down
2 changes: 1 addition & 1 deletion exercises/pangram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
"every letter") is a sentence using every letter of the alphabet at least once.
The best known English pangram is:
The best known English pangram is:
> The quick brown fox jumps over the lazy dog.

The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case
Expand Down
2 changes: 1 addition & 1 deletion exercises/pascals-triangle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Compute Pascal's triangle up to a given number of rows.
In Pascal's Triangle each number is computed by adding the numbers to
the right and left of the current position in the previous row.

```plain
```text
1
1 1
1 2 1
Expand Down
Loading