Stuart Kent 9 лет назад
Родитель
Сommit
ae9feebdaf
57 измененных файлов: 232 добавлений и 192 удалений
  1. 0
    3
      exercises/accumulate/README.md
  2. 0
    1
      exercises/acronym/README.md
  3. 1
    1
      exercises/all-your-base/README.md
  4. 0
    1
      exercises/allergies/README.md
  5. 2
    1
      exercises/atbash-cipher/README.md
  6. 1
    1
      exercises/beer-song/README.md
  7. 2
    0
      exercises/binary/README.md
  8. 5
    5
      exercises/book-store/README.md
  9. 20
    6
      exercises/bowling/README.md
  10. 1
    1
      exercises/change/README.md
  11. 13
    6
      exercises/circular-buffer/README.md
  12. 1
    1
      exercises/collatz-conjecture/README.md
  13. 27
    0
      exercises/complex-numbers/README.md
  14. 10
    8
      exercises/crypto-square/README.md
  15. 6
    6
      exercises/diamond/README.md
  16. 2
    0
      exercises/etl/README.md
  17. 1
    2
      exercises/flatten-array/README.md
  18. 1
    1
      exercises/food-chain/README.md
  19. 0
    1
      exercises/grade-school/README.md
  20. 1
    2
      exercises/house/README.md
  21. 2
    1
      exercises/isogram/README.md
  22. 13
    13
      exercises/kindergarten-garden/README.md
  23. 10
    10
      exercises/linked-list/README.md
  24. 4
    0
      exercises/list-ops/README.md
  25. 7
    7
      exercises/luhn/README.md
  26. 6
    4
      exercises/matrix/README.md
  27. 1
    2
      exercises/meetup/README.md
  28. 8
    22
      exercises/nucleotide-count/README.md
  29. 5
    5
      exercises/ocr-numbers/README.md
  30. 6
    2
      exercises/octal/README.md
  31. 15
    16
      exercises/palindrome-products/README.md
  32. 1
    1
      exercises/pangram/README.md
  33. 1
    1
      exercises/pascals-triangle/README.md
  34. 2
    2
      exercises/perfect-numbers/README.md
  35. 3
    2
      exercises/phone-number/README.md
  36. 3
    3
      exercises/pythagorean-triplet/README.md
  37. 1
    1
      exercises/queen-attack/README.md
  38. 7
    7
      exercises/rectangles/README.md
  39. 1
    1
      exercises/roman-numerals/README.md
  40. 2
    1
      exercises/rotational-cipher/README.md
  41. 4
    4
      exercises/run-length-encoding/README.md
  42. 1
    1
      exercises/saddle-points/README.md
  43. 3
    1
      exercises/scrabble-score/README.md
  44. 1
    1
      exercises/secret-handshake/README.md
  45. 1
    1
      exercises/simple-cipher/README.md
  46. 1
    1
      exercises/space-age/README.md
  47. 2
    2
      exercises/spiral-matrix/README.md
  48. 0
    3
      exercises/sum-of-multiples/README.md
  49. 6
    5
      exercises/tournament/README.md
  50. 7
    7
      exercises/transpose/README.md
  51. 9
    6
      exercises/triangle/README.md
  52. 1
    1
      exercises/trinary/README.md
  53. 1
    1
      exercises/twelve-days/README.md
  54. 1
    2
      exercises/two-fer/README.md
  55. 1
    2
      exercises/word-count/README.md
  56. 1
    1
      exercises/word-search/README.md
  57. 0
    5
      exercises/wordy/README.md

+ 0
- 3
exercises/accumulate/README.md Просмотреть файл

@@ -25,9 +25,6 @@ Keep your hands off that collect/map/fmap/whatchamacallit functionality
25 25
 provided by your standard library!
26 26
 Solve this one yourself using other basic tools instead.
27 27
 
28
-Lisp specific: it's perfectly fine to use `MAPCAR` or the equivalent,
29
-as this is idiomatic Lisp, not a library function.
30
-
31 28
 
32 29
 To run the tests:
33 30
 

+ 0
- 1
exercises/acronym/README.md Просмотреть файл

@@ -8,7 +8,6 @@ Help generate some jargon by writing a program that converts a long name
8 8
 like Portable Network Graphics to its acronym (PNG).
9 9
 
10 10
 
11
-
12 11
 To run the tests:
13 12
 
14 13
 ```sh

+ 1
- 1
exercises/all-your-base/README.md Просмотреть файл

@@ -6,6 +6,7 @@ Implement general base conversion. Given a number in base **a**,
6 6
 represented as a sequence of digits, convert it to base **b**.
7 7
 
8 8
 ## Note
9
+
9 10
 - Try to implement the conversion yourself.
10 11
   Do not use something else to perform the conversion for you.
11 12
 
@@ -28,7 +29,6 @@ The number 1120, *in base 3*, means:
28 29
 
29 30
 I think you got the idea!
30 31
 
31
-
32 32
 *Yes. Those three numbers above are exactly the same. Congratulations!*
33 33
 
34 34
 

+ 0
- 1
exercises/allergies/README.md Просмотреть файл

@@ -30,7 +30,6 @@ ignore those components of the score.  For example, if the allergy
30 30
 score is 257, your program should only report the eggs (1) allergy.
31 31
 
32 32
 
33
-
34 33
 To run the tests:
35 34
 
36 35
 ```sh

+ 2
- 1
exercises/atbash-cipher/README.md Просмотреть файл

@@ -9,7 +9,7 @@ letter, the second with the second-last, and so on.
9 9
 
10 10
 An Atbash cipher for the Latin alphabet would be as follows:
11 11
 
12
-```plain
12
+```text
13 13
 Plain:  abcdefghijklmnopqrstuvwxyz
14 14
 Cipher: zyxwvutsrqponmlkjihgfedcba
15 15
 ```
@@ -23,6 +23,7 @@ being 5 letters, and punctuation is excluded. This is to make it harder to guess
23 23
 things based on word boundaries.
24 24
 
25 25
 ## Examples
26
+
26 27
 - Encoding `test` gives `gvhg`
27 28
 - Decoding `gvhg` gives `test`
28 29
 - Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`

+ 1
- 1
exercises/beer-song/README.md Просмотреть файл

@@ -4,7 +4,7 @@ Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles
4 4
 
5 5
 Note that not all verses are identical.
6 6
 
7
-```plain
7
+```text
8 8
 99 bottles of beer on the wall, 99 bottles of beer.
9 9
 Take one down and pass it around, 98 bottles of beer on the wall.
10 10
 

+ 2
- 0
exercises/binary/README.md Просмотреть файл

@@ -7,10 +7,12 @@ string, your program should produce a decimal output. The
7 7
 program should handle invalid inputs.
8 8
 
9 9
 ## Note
10
+
10 11
 - Implement the conversion yourself.
11 12
   Do not use something else to perform the conversion for you.
12 13
 
13 14
 ## About Binary (Base-2)
15
+
14 16
 Decimal is a base-10 system.
15 17
 
16 18
 A number 23 in base 10 notation can be understood

+ 5
- 5
exercises/book-store/README.md Просмотреть файл

@@ -3,20 +3,20 @@
3 3
 To try and encourage more sales of different books from a popular 5 book
4 4
 series, a bookshop has decided to offer discounts on multiple book purchases.
5 5
 
6
-One copy of any of the five books costs $8. 
6
+One copy of any of the five books costs $8.
7 7
 
8 8
 If, however, you buy two different books, you get a 5%
9 9
 discount on those two books.
10 10
 
11
-If you buy 3 different books, you get a 10% discount. 
11
+If you buy 3 different books, you get a 10% discount.
12 12
 
13 13
 If you buy 4 different books, you get a 20% discount.
14 14
 
15
-If you buy all 5, you get a 25% discount. 
15
+If you buy all 5, you get a 25% discount.
16 16
 
17 17
 Note: that if you buy four books, of which 3 are
18 18
 different titles, you get a 10% discount on the 3 that
19
-form part of a set, but the fourth book still costs $8. 
19
+form part of a set, but the fourth book still costs $8.
20 20
 
21 21
 Your mission is to write a piece of code to calculate the
22 22
 price of any conceivable shopping basket (containing only
@@ -30,7 +30,7 @@ For example, how much does this basket of books cost?
30 30
 - 2 copies of the third book
31 31
 - 1 copy of the fourth book
32 32
 - 1 copy of the fifth book
33
- 
33
+
34 34
 One way of grouping these 8 books is:
35 35
 
36 36
 - 1 group of 5 --> 25% discount (1st,2nd,3rd,4th,5th)

+ 20
- 6
exercises/bowling/README.md Просмотреть файл

@@ -2,19 +2,29 @@
2 2
 
3 3
 Score a bowling game.
4 4
 
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
6 6
 arranged in a triangle. Write code to keep track of the score
7 7
 of a game of bowling.
8 8
 
9 9
 ## Scoring Bowling
10 10
 
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.
12 14
 
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.
14 18
 
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.
16 22
 
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.
18 28
 
19 29
 Here is a three frame example:
20 30
 
@@ -30,7 +40,11 @@ Frame 3 is (9 + 0) = 9
30 40
 
31 41
 This means the current running total is 48.
32 42
 
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.
34 48
 
35 49
 For a tenth frame of X1/ (strike and a spare), the total value is 20.
36 50
 

+ 1
- 1
exercises/change/README.md Просмотреть файл

@@ -28,7 +28,7 @@ For more detailed info about the Java track see the [help page](http://exercism.
28 28
 
29 29
 ## Source
30 30
 
31
-Software Craftsmanship - Kata-logue [http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata](http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata)
31
+Software Craftsmanship - Coin Change Kata [https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata](https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata)
32 32
 
33 33
 ## Submitting Incomplete Solutions
34 34
 It's possible to submit an incomplete solution so you can see how others have completed the exercise.

+ 13
- 6
exercises/circular-buffer/README.md Просмотреть файл

@@ -31,18 +31,25 @@ If the buffer has 7 elements then it is completely full:
31 31
 When the buffer is full an error will be raised, alerting the client
32 32
 that further writes are blocked until a slot becomes free.
33 33
 
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:
37 37
 
38 38
     [6][7][8][9][A][B][5]
39 39
 
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:
43 43
 
44 44
     [ ][7][8][9][A][B][ ]
45 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]
52
+
46 53
 
47 54
 To run the tests:
48 55
 

+ 1
- 1
exercises/collatz-conjecture/README.md Просмотреть файл

@@ -10,6 +10,7 @@ always reach 1 eventually.
10 10
 Given a number n, return the number of steps required to reach 1.
11 11
 
12 12
 ## Examples
13
+
13 14
 Starting with n = 12, the steps would be as follows:
14 15
 
15 16
 0. 12
@@ -26,7 +27,6 @@ Starting with n = 12, the steps would be as follows:
26 27
 Resulting in 9 steps. So for input n = 12, the return value would be 9.
27 28
 
28 29
 
29
-
30 30
 To run the tests:
31 31
 
32 32
 ```sh

+ 27
- 0
exercises/complex-numbers/README.md Просмотреть файл

@@ -2,6 +2,33 @@
2 2
 
3 3
 A complex number is a number in the form `a + b * i` where `a` and `b` are real and `i` satisfies `i^2 = -1`.
4 4
 
5
+`a` is called the real part and `b` is called the imaginary part of `z`.
6
+The conjugate of the number `a + b * i` is the number `a - b * i`.
7
+The absolute value of a complex number `z = a + b * i` is a real number `|z| = sqrt(a^2 + b^2)`. The square of the absolute value `|z|^2` is the result of multiplication of `z` by its complex conjugate.
8
+
9
+The sum/difference of two complex numbers involves adding/subtracting their real and imaginary parts separately:
10
+`(a + i * b) + (c + i * d) = (a + c) + (b + d) * i`,
11
+`(a + i * b) - (c + i * d) = (a - c) + (b - d) * i`.
12
+
13
+Multiplication result is by definition
14
+`(a + i * b) * (c + i * d) = (a * c - b * d) + (b * c + a * d) * i`.
15
+
16
+The reciprocal of a non-zero complex number is
17
+`1 / (a + i * b) = a/(a^2 + b^2) - b/(a^2 + b^2) * i`.
18
+
19
+Dividing a complex number `a + i * b` by another `c + i * d` gives:
20
+`(a + i * b) / (c + i * d) = (a * c + b * d)/(c^2 + d^2) + (b * c - a * d)/(c^2 + d^2) * i`.
21
+
22
+Exponent of a complex number can be expressed as
23
+`exp(a + i * b) = exp(a) * exp(i * b)`,
24
+and the last term is given by Euler's formula `exp(i * b) = cos(b) + i * sin(b)`.
25
+
26
+
27
+Implement the following operations:
28
+ - addition, subtraction, multiplication and division of two complex numbers,
29
+ - conjugate, absolute value, exponent of a given complex number.
30
+
31
+
5 32
 Assume the programming language you are using does not have an implementation of complex numbers.
6 33
 
7 34
 

+ 10
- 8
exercises/crypto-square/README.md Просмотреть файл

@@ -26,7 +26,7 @@ and `r` is the number of rows.
26 26
 Our normalized text is 54 characters long, dictating a rectangle with
27 27
 `c = 8` and `r = 7`:
28 28
 
29
-```plain
29
+```text
30 30
 ifmanwas
31 31
 meanttos
32 32
 tayonthe
@@ -41,22 +41,24 @@ right.
41 41
 
42 42
 The message above is coded as:
43 43
 
44
-```plain
44
+```text
45 45
 imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
46 46
 ```
47 47
 
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.
51 53
 
52
-```plain
53
-imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
54
+```text
55
+imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn  sseoau 
54 56
 ```
55 57
 
56 58
 Notice that were we to stack these, we could visually decode the
57 59
 cyphertext back in to the original message:
58 60
 
59
-```plain
61
+```text
60 62
 imtgdvs
61 63
 fearwer
62 64
 mayoogo

+ 6
- 6
exercises/diamond/README.md Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 # Diamond
2 2
 
3
-The diamond kata takes as its input a letter, and outputs it in a diamond 
4
-shape. Given a letter, it prints a diamond starting with 'A', with the 
3
+The diamond kata takes as its input a letter, and outputs it in a diamond
4
+shape. Given a letter, it prints a diamond starting with 'A', with the
5 5
 supplied letter at the widest point.
6 6
 
7 7
 ## Requirements
@@ -15,7 +15,7 @@ supplied letter at the widest point.
15 15
 * The diamond has a square shape (width equals height).
16 16
 * The letters form a diamond shape.
17 17
 * The top half has the letters in ascending order.
18
-* The bottom half has the letters in descending order. 
18
+* The bottom half has the letters in descending order.
19 19
 * The four corners (containing the spaces) are triangles.
20 20
 
21 21
 ## Examples
@@ -24,13 +24,13 @@ In the following examples, spaces are indicated by `·` characters.
24 24
 
25 25
 Diamond for letter 'A':
26 26
 
27
-```plain
27
+```text
28 28
 A
29 29
 ```
30 30
 
31 31
 Diamond for letter 'C':
32 32
 
33
-```plain
33
+```text
34 34
 ··A··
35 35
 ·B·B·
36 36
 C···C
@@ -40,7 +40,7 @@ C···C
40 40
 
41 41
 Diamond for letter 'E':
42 42
 
43
-```plain
43
+```text
44 44
 ····A····
45 45
 ···B·B···
46 46
 ··C···C··

+ 2
- 0
exercises/etl/README.md Просмотреть файл

@@ -3,6 +3,7 @@
3 3
 We are going to do the `Transform` step of an Extract-Transform-Load.
4 4
 
5 5
 ### ETL
6
+
6 7
 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
7 8
 we're going to migrate this."
8 9
 
@@ -11,6 +12,7 @@ once." That's then typically followed by much forehead slapping and
11 12
 moaning about how stupid we could possibly be.)
12 13
 
13 14
 ### The goal
15
+
14 16
 We're going to extract some scrabble scores from a legacy system.
15 17
 
16 18
 The old system stored a list of letters per score:

+ 1
- 2
exercises/flatten-array/README.md Просмотреть файл

@@ -3,7 +3,7 @@
3 3
 Take a nested list and return a single flattened list with all values except nil/null.
4 4
 
5 5
 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
+
7 7
 For Example
8 8
 
9 9
 input: [1,[2,3,null,4],[null],5]
@@ -11,7 +11,6 @@ input: [1,[2,3,null,4],[null],5]
11 11
 output: [1,2,3,4,5]
12 12
 
13 13
 
14
-
15 14
 To run the tests:
16 15
 
17 16
 ```sh

+ 1
- 1
exercises/food-chain/README.md Просмотреть файл

@@ -10,7 +10,7 @@ This is a [cumulative song](http://en.wikipedia.org/wiki/Cumulative_song) of unk
10 10
 
11 11
 This is one of many common variants.
12 12
 
13
-```plain
13
+```text
14 14
 I know an old lady who swallowed a fly.
15 15
 I don't know why she swallowed the fly. Perhaps she'll die.
16 16
 

+ 0
- 1
exercises/grade-school/README.md Просмотреть файл

@@ -21,7 +21,6 @@ In the end, you should be able to:
21 21
 Note that all our students only have one name.  (It's a small town, what
22 22
 do you want?)
23 23
 
24
-
25 24
 ## For bonus points
26 25
 
27 26
 Did you get the tests passing and the code clean? If you want to, these

+ 1
- 2
exercises/house/README.md Просмотреть файл

@@ -11,10 +11,9 @@ Output the nursery rhyme 'This is the House that Jack Built'.
11 11
 
12 12
 - [papyr.com](http://papyr.com/hypertextbooks/grammar/ph_noun.htm)
13 13
 
14
-
15 14
 The nursery rhyme reads as follows:
16 15
 
17
-```plain
16
+```text
18 17
 This is the house that Jack built.
19 18
 
20 19
 This is the malt

+ 2
- 1
exercises/isogram/README.md Просмотреть файл

@@ -2,13 +2,14 @@
2 2
 
3 3
 Determine if a word or phrase is an isogram.
4 4
 
5
-An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
5
+An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.
6 6
 
7 7
 Examples of isograms:
8 8
 
9 9
 - lumberjacks
10 10
 - background
11 11
 - downstream
12
+- six-year-old
12 13
 
13 14
 The word *isograms*, however, is not an isogram, because the s repeats.
14 15
 

+ 13
- 13
exercises/kindergarten-garden/README.md Просмотреть файл

@@ -3,19 +3,19 @@
3 3
 Given a diagram, determine which plants each child in the kindergarten class is
4 4
 responsible for.
5 5
 
6
-The kindergarten class is learning about growing plants. The teachers
6
+The kindergarten class is learning about growing plants. The teacher
7 7
 thought it would be a good idea to give them actual seeds, plant them in
8 8
 actual dirt, and grow actual plants.
9 9
 
10 10
 They've chosen to grow grass, clover, radishes, and violets.
11 11
 
12
-To this end, they've put little styrofoam cups along the window sills,
13
-and planted one type of plant in each cup, choosing randomly from the
14
-available types of seeds.
12
+To this end, the children have put little cups along the window sills, and 
13
+planted one type of plant in each cup, choosing randomly from the available 
14
+types of seeds.
15 15
 
16
-```plain
16
+```text
17 17
 [window][window][window]
18
-........................ # each dot represents a styrofoam cup
18
+........................ # each dot represents a cup
19 19
 ........................
20 20
 ```
21 21
 
@@ -25,27 +25,27 @@ There are 12 children in the class:
25 25
 - Eve, Fred, Ginny, Harriet,
26 26
 - Ileana, Joseph, Kincaid, and Larry.
27 27
 
28
-Each child gets 4 cups, two on each row. The children are assigned to
29
-cups in alphabetical order.
28
+Each child gets 4 cups, two on each row. Their teacher assigns cups to 
29
+the children alphabetically by their names.
30 30
 
31 31
 The following diagram represents Alice's plants:
32 32
 
33
-```plain
33
+```text
34 34
 [window][window][window]
35 35
 VR......................
36 36
 RG......................
37 37
 ```
38 38
 
39
-So in the row nearest the window, she has a violet and a radish; in the
40
-row behind that, she has a radish and some grass.
39
+In the first row, nearest the windows, she has a violet and a radish.  In the
40
+second row she has a radish and some grass.
41 41
 
42 42
 Your program will be given the plants from left-to-right starting with
43 43
 the row nearest the windows. From this, it should be able to determine
44
-which plants belong to which students.
44
+which plants belong to each student.
45 45
 
46 46
 For example, if it's told that the garden looks like so:
47 47
 
48
-```plain
48
+```text
49 49
 [window][window][window]
50 50
 VRCGVVRVCGGCCGVRGCVCGCGV
51 51
 VRCCCGCRRGVCGCRVVCVGCGCV

+ 10
- 10
exercises/linked-list/README.md Просмотреть файл

@@ -2,18 +2,18 @@
2 2
 
3 3
 Implement a doubly linked list.
4 4
 
5
-Like an array, a linked list is a simple linear data structure. Several 
6
-common data types can be implemented using linked lists, like queues, 
5
+Like an array, a linked list is a simple linear data structure. Several
6
+common data types can be implemented using linked lists, like queues,
7 7
 stacks, and associative arrays.
8 8
 
9
-A linked list is a collection of data elements called *nodes*. In a 
10
-*singly linked list* each node holds a value and a link to the next node. 
11
-In a *doubly linked list* each node also holds a link to the previous 
9
+A linked list is a collection of data elements called *nodes*. In a
10
+*singly linked list* each node holds a value and a link to the next node.
11
+In a *doubly linked list* each node also holds a link to the previous
12 12
 node.
13 13
 
14
-You will write an implementation of a doubly linked list. Implement a 
15
-Node to hold a value and pointers to the next and previous nodes. Then 
16
-implement a List which holds references to the first and last node and 
14
+You will write an implementation of a doubly linked list. Implement a
15
+Node to hold a value and pointers to the next and previous nodes. Then
16
+implement a List which holds references to the first and last node and
17 17
 offers an array-like interface for adding and removing items:
18 18
 
19 19
 * `push` (*insert value at back*);
@@ -21,8 +21,8 @@ offers an array-like interface for adding and removing items:
21 21
 * `shift` (*remove value at front*).
22 22
 * `unshift` (*insert value at front*);
23 23
 
24
-To keep your implementation simple, the tests will not cover error 
25
-conditions. Specifically: `pop` or `shift` will never be called on an 
24
+To keep your implementation simple, the tests will not cover error
25
+conditions. Specifically: `pop` or `shift` will never be called on an
26 26
 empty list.
27 27
 
28 28
 If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list).

+ 4
- 0
exercises/list-ops/README.md Просмотреть файл

@@ -8,6 +8,10 @@ without using existing functions.
8 8
 
9 9
 ## Hints
10 10
 
11
+In Java it's considered best practice to use instance methods over class methods. However, there are conditions in which it is absolutely appropriate for a function to be `static`. Since classes in Java are closed for modification (i.e. you cannot add members to a class outside its definition like you can in other languages like Ruby or JavaScript), you cannot add new behavior to the class directly. What to do if you still want to define behavior for a given type? The idiomatic solution in this case is to write a utility method. 
12
+Collections of these kinds of methods are often referred to as "utility classes". Examples of such classes from within the JRE include [Arrays](https://docs.oracle.com/javase/9/docs/api/java/util/Arrays.html) and [Collections](https://docs.oracle.com/javase/9/docs/api/java/util/Collections.html).
13
+In this exercise we want a List to have `map()`, `reduce()`, `filter()`, etc. methods. It doesn't, so we're using static methods.
14
+
11 15
 The `foldLeft` and `foldRight` methods are "fold" functions, which is a concept well-known in the functional programming world, but less so in the object-oriented one. See the Wikipedia page on folding for [general background](https://en.wikipedia.org/wiki/Fold_(higher-order_function)) and [signature/implementation hints](https://en.wikipedia.org/wiki/Fold_(higher-order_function)#Linear_folds).
12 16
 
13 17
 

+ 7
- 7
exercises/luhn/README.md Просмотреть файл

@@ -18,27 +18,27 @@ are disallowed.
18 18
 
19 19
 ## Example 1: valid credit card number
20 20
 
21
-```
21
+```text
22 22
 4539 1488 0343 6467
23 23
 ```
24 24
 
25 25
 The first step of the Luhn algorithm is to double every second digit,
26 26
 starting from the right. We will be doubling
27 27
 
28
-```
28
+```text
29 29
 4_3_ 1_8_ 0_4_ 6_6_
30 30
 ```
31 31
 
32 32
 If doubling the number results in a number greater than 9 then subtract 9
33 33
 from the product. The results of our doubling:
34 34
 
35
-```
35
+```text
36 36
 8569 2478 0383 3437
37 37
 ```
38 38
 
39 39
 Then sum all of the digits:
40 40
 
41
-```
41
+```text
42 42
 8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
43 43
 ```
44 44
 
@@ -46,19 +46,19 @@ If the sum is evenly divisible by 10, then the number is valid. This number is v
46 46
 
47 47
 ## Example 2: invalid credit card number
48 48
 
49
-```
49
+```text
50 50
 8273 1232 7352 0569
51 51
 ```
52 52
 
53 53
 Double the second digits, starting from the right
54 54
 
55
-```
55
+```text
56 56
 7253 2262 5312 0539
57 57
 ```
58 58
 
59 59
 Sum the digits
60 60
 
61
-```
61
+```text
62 62
 7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
63 63
 ```
64 64
 

+ 6
- 4
exercises/matrix/README.md Просмотреть файл

@@ -5,13 +5,15 @@ that matrix.
5 5
 
6 6
 So given a string with embedded newlines like:
7 7
 
8
-> 9 8 7  
9
-> 5 3 2  
10
-> 6 6 7  
8
+```text
9
+9 8 7
10
+5 3 2
11
+6 6 7
12
+```
11 13
 
12 14
 representing this matrix:
13 15
 
14
-```plain
16
+```text
15 17
     0  1  2
16 18
   |---------
17 19
 0 | 9  8  7

+ 1
- 2
exercises/meetup/README.md Просмотреть файл

@@ -18,10 +18,9 @@ end in '-teenth'. Therefore, one is guaranteed that each day of the week
18 18
 (Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
19 19
 in every month.
20 20
 
21
-Given examples of a meetup dates, each containing a month, day, year, and descriptor 
21
+Given examples of a meetup dates, each containing a month, day, year, and descriptor
22 22
 (first, second, teenth, etc), calculate the date of the actual meetup.
23 23
 For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
24
- 
25 24
 
26 25
 
27 26
 To run the tests:

+ 8
- 22
exercises/nucleotide-count/README.md Просмотреть файл

@@ -1,30 +1,16 @@
1 1
 # Nucleotide Count
2 2
 
3
-Given a DNA string, compute how many times each nucleotide occurs in the string.
3
+Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.
4 4
 
5
-DNA is represented by an alphabet of the following symbols: 'A', 'C',
6
-'G', and 'T'.
7
-
8
-Each symbol represents a nucleotide, which is a fancy name for the
9
-particular molecules that happen to make up a large part of DNA.
10
-
11
-Shortest intro to biochemistry EVAR:
5
+The genetic language of every living thing on the planet is DNA. 
6
+DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides. 
7
+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.
12 8
 
9
+Here is an analogy:
13 10
 - twigs are to birds nests as
14
-- nucleotides are to DNA and RNA as
15
-- amino acids are to proteins as
16
-- sugar is to starch as
17
-- oh crap lipids
18
-
19
-I'm not going to talk about lipids because they're crazy complex.
20
-
21
-So back to nucleotides.
22
-
23
-DNA contains four types of them: adenine (`A`), cytosine (`C`), guanine
24
-(`G`), and thymine (`T`).
25
-
26
-RNA contains a slightly different set of nucleotides, but we don't care
27
-about that for now.
11
+- nucleotides are to DNA as
12
+- legos are to lego houses as
13
+- words are to sentences as...
28 14
 
29 15
 
30 16
 To run the tests:

+ 5
- 5
exercises/ocr-numbers/README.md Просмотреть файл

@@ -9,7 +9,7 @@ To begin with, convert a simple binary font to a string containing 0 or 1.
9 9
 
10 10
 The binary font uses pipes and underscores, four rows high and three columns wide.
11 11
 
12
-```
12
+```text
13 13
      _   #
14 14
     | |  # zero.
15 15
     |_|  #
@@ -18,7 +18,7 @@ The binary font uses pipes and underscores, four rows high and three columns wid
18 18
 
19 19
 Is converted to "0"
20 20
 
21
-```
21
+```text
22 22
          #
23 23
       |  # one.
24 24
       |  #
@@ -39,7 +39,7 @@ Update your program to recognize multi-character binary strings, replacing garbl
39 39
 
40 40
 Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.
41 41
 
42
-```
42
+```text
43 43
  _ 
44 44
  _|
45 45
 |_ 
@@ -48,7 +48,7 @@ Update your program to recognize all numbers 0 through 9, both individually and
48 48
 
49 49
 Is converted to "2"
50 50
 
51
-```
51
+```text
52 52
       _  _     _  _  _  _  _  _  #
53 53
     | _| _||_||_ |_   ||_||_|| | # decimal numbers.
54 54
     ||_  _|  | _||_|  ||_| _||_| #
@@ -61,7 +61,7 @@ Is converted to "1234567890"
61 61
 
62 62
 Update your program to handle multiple numbers, one per line. When converting several lines, join the lines with commas.
63 63
 
64
-```
64
+```text
65 65
     _  _ 
66 66
   | _| _|
67 67
   ||_  _|

+ 6
- 2
exercises/octal/README.md Просмотреть файл

@@ -8,11 +8,13 @@ Implement octal to decimal conversion.  Given an octal input
8 8
 string, your program should produce a decimal output.
9 9
 
10 10
 ## Note
11
+
11 12
 - Implement the conversion yourself.
12 13
   Do not use something else to perform the conversion for you.
13 14
 - Treat invalid input as octal 0.
14 15
 
15 16
 ## About Octal (Base-8)
17
+
16 18
 Decimal is a base-10 system.
17 19
 
18 20
 A number 233 in base 10 notation can be understood
@@ -25,7 +27,8 @@ as a linear combination of powers of 10:
25 27
 - All these values are summed.
26 28
 
27 29
 So:
28
-```
30
+
31
+```text
29 32
    233 # decimal
30 33
  = 2*10^2 + 3*10^1 + 3*10^0
31 34
  = 2*100  + 3*10   + 3*1
@@ -34,7 +37,8 @@ So:
34 37
 Octal is similar, but uses powers of 8 rather than powers of 10.
35 38
 
36 39
 So:
37
-```
40
+
41
+```text
38 42
    233 # octal
39 43
  = 2*8^2 + 3*8^1 + 3*8^0
40 44
  = 2*64  + 3*8   + 3*1

+ 15
- 16
exercises/palindrome-products/README.md Просмотреть файл

@@ -5,33 +5,32 @@ Detect palindrome products in a given range.
5 5
 A palindromic number is a number that remains the same when its digits are
6 6
 reversed. For example, `121` is a palindromic number but `112` is not.
7 7
 
8
-Given the definition of a palindromic number, we define a palindrome _product_
9
-to be the product `c`, such that `a * b = c`, where `c` is a palindromic number and
10
- `a` and `b` are integers (possibly, but _not_ necessarily palindromic numbers).
8
+Given a range of numbers, find the largest and smallest palindromes which
9
+are products of numbers within that range.
11 10
 
12
-For example, the palindromic number 9009 can be written as the palindrome
13
-product: `91 * 99 = 9009`.
14
-
15
-It's possible (and indeed common) for a palindrome product to be the product
16
-of multiple combinations of numbers. For example, the palindrome product `9` has
17
-the factors `(1, 9)`, `(3, 3)`, and `(9, 1)`.
18
-
19
-Write a program that given a range of integers, returns the smallest and largest
20
-palindromic product within that range, along with all of it's factors.
11
+Your solution should return the largest and smallest palindromes, along with the
12
+factors of each within the range. If the largest or smallest palindrome has more 
13
+than one pair of factors within the range, then return all the pairs.
21 14
 
22 15
 ## Example 1
23 16
 
24 17
 Given the range `[1, 9]` (both inclusive)...
25 18
 
26
-The smallest product is `1`. It's factors are `(1, 1)`.
27
-The largest product is `9`. It's factors are `(1, 9)`, `(3, 3)`, and `(9, 1)`.
19
+And given the list of all possible products within this range:
20
+`[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 15, 21, 24, 27, 20, 28, 32, 36, 25, 30, 35, 40, 45, 42, 48, 54, 49, 56, 63, 64, 72, 81]`
21
+
22
+The palindrome products are all single digit numbers (in this case):
23
+`[1, 2, 3, 4, 5, 6, 7, 8, 9]`
24
+
25
+The smallest palindrome product is `1`. Its factors are `(1, 1)`.
26
+The largest palindrome product is `9`. Its factors are `(1, 9)` and `(3, 3)`.
28 27
 
29 28
 ## Example 2
30 29
 
31 30
 Given the range `[10, 99]` (both inclusive)...
32 31
 
33
-The smallest palindrome product is `121`. It's factors are `(11, 11)`.
34
-The largest palindrome product is `9009`. It's factors are `(91, 99)` and `(99, 91)`.
32
+The smallest palindrome product is `121`. Its factors are `(11, 11)`.
33
+The largest palindrome product is `9009`. Its factors are `(91, 99)`.
35 34
 
36 35
 
37 36
 To run the tests:

+ 1
- 1
exercises/pangram/README.md Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 
3 3
 Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
4 4
 "every letter") is a sentence using every letter of the alphabet at least once.
5
-The best known English pangram is: 
5
+The best known English pangram is:
6 6
 > The quick brown fox jumps over the lazy dog.
7 7
 
8 8
 The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case

+ 1
- 1
exercises/pascals-triangle/README.md Просмотреть файл

@@ -5,7 +5,7 @@ Compute Pascal's triangle up to a given number of rows.
5 5
 In Pascal's Triangle each number is computed by adding the numbers to
6 6
 the right and left of the current position in the previous row.
7 7
 
8
-```plain
8
+```text
9 9
     1
10 10
    1 1
11 11
   1 2 1

+ 2
- 2
exercises/perfect-numbers/README.md Просмотреть файл

@@ -5,7 +5,7 @@ Nicomachus' (60 - 120 CE) classification scheme for natural numbers.
5 5
 
6 6
 The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) devised a classification scheme for natural numbers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum](https://en.wikipedia.org/wiki/Aliquot_sum). The aliquot sum is defined as the sum of the factors of a number not including the number itself. For example, the aliquot sum of 15 is (1 + 3 + 5) = 9
7 7
 
8
-- **Perfect**: aliquot sum = number 
8
+- **Perfect**: aliquot sum = number
9 9
   - 6 is a perfect number because (1 + 2 + 3) = 6
10 10
   - 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
11 11
 - **Abundant**: aliquot sum > number
@@ -14,7 +14,7 @@ The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) d
14 14
 - **Deficient**: aliquot sum < number
15 15
   - 8 is a deficient number because (1 + 2 + 4) = 7
16 16
   - Prime numbers are deficient
17
-  
17
+
18 18
 Implement a way to determine whether a given number is **perfect**. Depending on your language track, you may also need to implement a way to determine whether a given number is **abundant** or **deficient**.
19 19
 
20 20
 

+ 3
- 2
exercises/phone-number/README.md Просмотреть файл

@@ -6,11 +6,12 @@ The **North American Numbering Plan (NANP)** is a telephone numbering system use
6 6
 
7 7
 NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number. The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*.
8 8
 
9
-
10 9
 The format is usually represented as
11
-```
10
+
11
+```text
12 12
 (NXX)-NXX-XXXX
13 13
 ```
14
+
14 15
 where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
15 16
 
16 17
 Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.

+ 3
- 3
exercises/pythagorean-triplet/README.md Просмотреть файл

@@ -3,13 +3,13 @@
3 3
 A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for
4 4
 which,
5 5
 
6
-```
6
+```text
7 7
 a**2 + b**2 = c**2
8 8
 ```
9 9
 
10
-For example, 
10
+For example,
11 11
 
12
-```
12
+```text
13 13
 3**2 + 4**2 = 9 + 16 = 25 = 5**2.
14 14
 ```
15 15
 

+ 1
- 1
exercises/queen-attack/README.md Просмотреть файл

@@ -11,7 +11,7 @@ A chessboard can be represented by an 8 by 8 array.
11 11
 So if you're told the white queen is at (2, 3) and the black queen at
12 12
 (5, 6), then you'd know you've got a set-up like so:
13 13
 
14
-```plain
14
+```text
15 15
 _ _ _ _ _ _ _ _
16 16
 _ _ _ _ _ _ _ _
17 17
 _ _ _ W _ _ _ _

+ 7
- 7
exercises/rectangles/README.md Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 
3 3
 Count the rectangles in an ASCII diagram like the one below.
4 4
 
5
-```
5
+```text
6 6
    +--+
7 7
   ++  |
8 8
 +-++--+
@@ -12,7 +12,7 @@ Count the rectangles in an ASCII diagram like the one below.
12 12
 
13 13
 The above diagram contains 6 rectangles:
14 14
 
15
-```
15
+```text
16 16
 
17 17
 
18 18
 +-----+
@@ -20,7 +20,7 @@ The above diagram contains 6 rectangles:
20 20
 +-----+
21 21
 ```
22 22
 
23
-```
23
+```text
24 24
    +--+
25 25
    |  |
26 26
    |  |
@@ -28,7 +28,7 @@ The above diagram contains 6 rectangles:
28 28
    +--+
29 29
 ```
30 30
 
31
-```
31
+```text
32 32
    +--+
33 33
    |  |
34 34
    +--+
@@ -36,7 +36,7 @@ The above diagram contains 6 rectangles:
36 36
 
37 37
 ```
38 38
 
39
-```
39
+```text
40 40
        
41 41
        
42 42
    +--+
@@ -44,7 +44,7 @@ The above diagram contains 6 rectangles:
44 44
    +--+
45 45
 ```
46 46
 
47
-```
47
+```text
48 48
        
49 49
        
50 50
 +--+
@@ -52,7 +52,7 @@ The above diagram contains 6 rectangles:
52 52
 +--+
53 53
 ```
54 54
 
55
-```
55
+```text
56 56
        
57 57
   ++   
58 58
   ++   

+ 1
- 1
exercises/roman-numerals/README.md Просмотреть файл

@@ -14,7 +14,7 @@ The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice
14 14
 these letters have lots of straight lines and are hence easy to hack
15 15
 into stone tablets).
16 16
 
17
-```
17
+```text
18 18
  1  => I
19 19
 10  => X
20 20
  7  => VII

+ 2
- 1
exercises/rotational-cipher/README.md Просмотреть файл

@@ -13,7 +13,7 @@ The most commonly used rotational cipher is `ROT13`.
13 13
 
14 14
 A `ROT13` on the Latin alphabet would be as follows:
15 15
 
16
-```plain
16
+```text
17 17
 Plain:  abcdefghijklmnopqrstuvwxyz
18 18
 Cipher: nopqrstuvwxyzabcdefghijklm
19 19
 ```
@@ -23,6 +23,7 @@ It is stronger than the Atbash cipher because it has 27 possible keys, and 25 us
23 23
 Ciphertext is written out in the same formatting as the input including spaces and punctuation.
24 24
 
25 25
 ## Examples
26
+
26 27
 - ROT5  `omg` gives `trl`
27 28
 - ROT0  `c` gives `c`
28 29
 - ROT26 `Cool` gives `Cool`

+ 4
- 4
exercises/run-length-encoding/README.md Просмотреть файл

@@ -7,20 +7,20 @@ Run-length encoding (RLE) is a simple form of data compression, where runs
7 7
 
8 8
 For example we can represent the original 53 characters with only 13.
9 9
 
10
-```
10
+```text
11 11
 "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"  ->  "12WB12W3B24WB"
12 12
 ```
13 13
 
14 14
 RLE allows the original data to be perfectly reconstructed from
15 15
 the compressed data, which makes it a lossless data compression.
16 16
 
17
-```
17
+```text
18 18
 "AABCCCDEEEE"  ->  "2AB3CD4E"  ->  "AABCCCDEEEE"
19 19
 ```
20 20
 
21 21
 For simplicity, you can assume that the unencoded string will only contain
22
-the letters A through Z (either lower or upper case) and whitespace. This way 
23
-data to be encoded will never contain any numbers and numbers inside data to 
22
+the letters A through Z (either lower or upper case) and whitespace. This way
23
+data to be encoded will never contain any numbers and numbers inside data to
24 24
 be decoded always represent the count for the following character.
25 25
 
26 26
 

+ 1
- 1
exercises/saddle-points/README.md Просмотреть файл

@@ -4,7 +4,7 @@ Detect saddle points in a matrix.
4 4
 
5 5
 So say you have a matrix like so:
6 6
 
7
-```plain
7
+```text
8 8
     0  1  2
9 9
   |---------
10 10
 0 | 9  8  7

+ 3
- 1
exercises/scrabble-score/README.md Просмотреть файл

@@ -6,7 +6,7 @@ Given a word, compute the scrabble score for that word.
6 6
 
7 7
 You'll need these:
8 8
 
9
-```plain
9
+```text
10 10
 Letter                           Value
11 11
 A, E, I, O, U, L, N, R, S, T       1
12 12
 D, G                               2
@@ -18,6 +18,7 @@ Q, Z                               10
18 18
 ```
19 19
 
20 20
 ## Examples
21
+
21 22
 "cabbage" should be scored as worth 14 points:
22 23
 
23 24
 - 3 points for C
@@ -34,6 +35,7 @@ And to total:
34 35
 - = 14
35 36
 
36 37
 ## Extensions
38
+
37 39
 - You can play a double or a triple letter.
38 40
 - You can play a double or a triple word.
39 41
 

+ 1
- 1
exercises/secret-handshake/README.md Просмотреть файл

@@ -6,7 +6,7 @@
6 6
 You and your fellow cohort of those in the "know" when it comes to
7 7
 binary decide to come up with a secret "handshake".
8 8
 
9
-```
9
+```text
10 10
 1 = wink
11 11
 10 = double blink
12 12
 100 = close your eyes

+ 1
- 1
exercises/simple-cipher/README.md Просмотреть файл

@@ -47,7 +47,7 @@ Given the key "aaaaaaaaaaaaaaaaaa", encoding the string "iamapandabear"
47 47
 would return the original "iamapandabear".
48 48
 
49 49
 Given the key "ddddddddddddddddd", encoding our string "iamapandabear"
50
-would return the obscured "lpdsdqgdehdu"
50
+would return the obscured "ldpdsdqgdehdu"
51 51
 
52 52
 In the example above, we've set a = 0 for the key value. So when the
53 53
 plaintext is added to the key, we end up with the same message coming

+ 1
- 1
exercises/space-age/README.md Просмотреть файл

@@ -12,7 +12,7 @@ Given an age in seconds, calculate how old someone would be on:
12 12
    - Neptune: orbital period 164.79132 Earth years
13 13
 
14 14
 So if you were told someone were 1,000,000,000 seconds old, you should
15
-be able to say that they're 31 Earth-years old.
15
+be able to say that they're 31.69 Earth-years old.
16 16
 
17 17
 If you're wondering why Pluto didn't make the cut, go watch [this
18 18
 youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).

+ 2
- 2
exercises/spiral-matrix/README.md Просмотреть файл

@@ -8,7 +8,7 @@ like these examples:
8 8
 
9 9
 ###### Spiral matrix of size 3
10 10
 
11
-```plain
11
+```text
12 12
 1 2 3
13 13
 8 9 4
14 14
 7 6 5
@@ -16,7 +16,7 @@ like these examples:
16 16
 
17 17
 ###### Spiral matrix of size 4
18 18
 
19
-```plain
19
+```text
20 20
  1  2  3 4
21 21
 12 13 14 5
22 22
 11 16 15 6

+ 0
- 3
exercises/sum-of-multiples/README.md Просмотреть файл

@@ -8,9 +8,6 @@ multiples of either 3 or 5, we get 3, 5, 6 and 9, 10, 12, 15, and 18.
8 8
 
9 9
 The sum of these multiples is 78.
10 10
 
11
-Given a number, find the sum of the multiples of a given set of numbers,
12
-up to but not including that number.
13
-
14 11
 
15 12
 To run the tests:
16 13
 

+ 6
- 5
exercises/tournament/README.md Просмотреть файл

@@ -5,7 +5,7 @@ Tally the results of a small football competition.
5 5
 Based on an input file containing which team played against which and what the
6 6
 outcome was, create a file with a table like this:
7 7
 
8
-```
8
+```text
9 9
 Team                           | MP |  W |  D |  L |  P
10 10
 Devastating Donkeys            |  3 |  2 |  1 |  0 |  7
11 11
 Allegoric Alaskans             |  3 |  2 |  0 |  1 |  6
@@ -31,7 +31,7 @@ Input
31 31
 
32 32
 Your tallying program will receive input that looks like:
33 33
 
34
-```
34
+```text
35 35
 Allegoric Alaskans;Blithering Badgers;win
36 36
 Devastating Donkeys;Courageous Californians;draw
37 37
 Devastating Donkeys;Allegoric Alaskans;win
@@ -42,7 +42,7 @@ Allegoric Alaskans;Courageous Californians;win
42 42
 
43 43
 The result of the match refers to the first team listed. So this line
44 44
 
45
-```
45
+```text
46 46
 Allegoric Alaskans;Blithering Badgers;win
47 47
 ```
48 48
 
@@ -50,7 +50,7 @@ Means that the Allegoric Alaskans beat the Blithering Badgers.
50 50
 
51 51
 This line:
52 52
 
53
-```
53
+```text
54 54
 Courageous Californians;Blithering Badgers;loss
55 55
 ```
56 56
 
@@ -58,7 +58,7 @@ Means that the Blithering Badgers beat the Courageous Californians.
58 58
 
59 59
 And this line:
60 60
 
61
-```
61
+```text
62 62
 Devastating Donkeys;Courageous Californians;draw
63 63
 ```
64 64
 
@@ -74,5 +74,6 @@ $ gradle test
74 74
 For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
75 75
 
76 76
 
77
+
77 78
 ## Submitting Incomplete Solutions
78 79
 It's possible to submit an incomplete solution so you can see how others have completed the exercise.

+ 7
- 7
exercises/transpose/README.md Просмотреть файл

@@ -4,14 +4,14 @@ Given an input text output it transposed.
4 4
 
5 5
 Roughly explained, the transpose of a matrix:
6 6
 
7
-```
7
+```text
8 8
 ABC
9 9
 DEF
10 10
 ```
11 11
 
12 12
 is given by:
13 13
 
14
-```
14
+```text
15 15
 AD
16 16
 BE
17 17
 CF
@@ -26,14 +26,14 @@ If the input has rows of different lengths, this is to be solved as follows:
26 26
 
27 27
 Therefore, transposing this matrix:
28 28
 
29
-```
29
+```text
30 30
 ABC
31 31
 DE
32 32
 ```
33 33
 
34 34
 results in:
35 35
 
36
-```
36
+```text
37 37
 AD
38 38
 BE
39 39
 C
@@ -41,21 +41,21 @@ C
41 41
 
42 42
 And transposing:
43 43
 
44
-```
44
+```text
45 45
 AB
46 46
 DEF
47 47
 ```
48 48
 
49 49
 results in:
50 50
 
51
-```
51
+```text
52 52
 AD
53 53
 BE
54 54
  F
55 55
 ```
56 56
 
57 57
 In general, all characters from the input should also be present in the transposed output.
58
-That means that if a column in the input text contains only spaces on its bottom-most row(s), 
58
+That means that if a column in the input text contains only spaces on its bottom-most row(s),
59 59
 the corresponding output row should contain the spaces in its right-most column(s).
60 60
 
61 61
 

+ 9
- 6
exercises/triangle/README.md Просмотреть файл

@@ -2,24 +2,27 @@
2 2
 
3 3
 Determine if a triangle is equilateral, isosceles, or scalene.
4 4
 
5
-An _equilateral_ triangle has all three sides the same length.<br/>
5
+An _equilateral_ triangle has all three sides the same length.
6
+
6 7
 An _isosceles_ triangle has at least two sides the same length. (It is sometimes
7 8
 specified as having exactly two sides the same length, but for the purposes of
8
-this exercise we'll say at least two.)<br/>
9
+this exercise we'll say at least two.)
10
+
9 11
 A _scalene_ triangle has all sides of different lengths.
10 12
 
11 13
 ## Note
12 14
 
13
-For a shape to be a triangle at all, all sides have to be of length > 0, and 
14
-the sum of the lengths of any two sides must be greater than or equal to the 
15
+For a shape to be a triangle at all, all sides have to be of length > 0, and
16
+the sum of the lengths of any two sides must be greater than or equal to the
15 17
 length of the third side. See [Triangle Inequality](https://en.wikipedia.org/wiki/Triangle_inequality).
16 18
 
17 19
 ## Dig Deeper
18 20
 
19
-The case where the sum of the lengths of two sides _equals_ that of the 
20
-third is known as a _degenerate_ triangle - it has zero area and looks like 
21
+The case where the sum of the lengths of two sides _equals_ that of the
22
+third is known as a _degenerate_ triangle - it has zero area and looks like
21 23
 a single line. Feel free to add your own code/tests to check for degenerate triangles.
22 24
 
25
+
23 26
 To run the tests:
24 27
 
25 28
 ```sh

+ 1
- 1
exercises/trinary/README.md Просмотреть файл

@@ -11,7 +11,7 @@ Trinary numbers contain three symbols: 0, 1, and 2.
11 11
 The last place in a trinary number is the 1's place. The second to last
12 12
 is the 3's place, the third to last is the 9's place, etc.
13 13
 
14
-```bash
14
+```shell
15 15
 # "102012"
16 16
     1       0       2       0       1       2    # the number
17 17
 1*3^5 + 0*3^4 + 2*3^3 + 0*3^2 + 1*3^1 + 2*3^0    # the value

+ 1
- 1
exercises/twelve-days/README.md Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 
3 3
 Output the lyrics to 'The Twelve Days of Christmas'.
4 4
 
5
-```
5
+```text
6 6
 On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.
7 7
 
8 8
 On the second day of Christmas my true love gave to me, two Turtle Doves, and a Partridge in a Pear Tree.

+ 1
- 2
exercises/two-fer/README.md Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 
3 3
 `Two-fer` or `2-fer` is short for two for one. One for you and one for me.
4 4
 
5
-```
5
+```text
6 6
 "One for X, one for me."
7 7
 ```
8 8
 
@@ -11,7 +11,6 @@ When X is a name or "you".
11 11
 If the given name is "Alice", the result should be "One for Alice, one for me."
12 12
 If no name is given, the result should be "One for you, one for me."
13 13
 
14
-
15 14
 ## Test-Driven Development
16 15
 
17 16
 As programmers mature, they eventually want to test their code.

+ 1
- 2
exercises/word-count/README.md Просмотреть файл

@@ -4,7 +4,7 @@ Given a phrase, count the occurrences of each word in that phrase.
4 4
 
5 5
 For example for the input `"olly olly in come free"`
6 6
 
7
-```plain
7
+```text
8 8
 olly: 2
9 9
 in: 1
10 10
 come: 1
@@ -12,7 +12,6 @@ free: 1
12 12
 ```
13 13
 
14 14
 
15
-
16 15
 To run the tests:
17 16
 
18 17
 ```sh

+ 1
- 1
exercises/word-search/README.md Просмотреть файл

@@ -5,7 +5,7 @@ words in them.
5 5
 
6 6
 For example:
7 7
 
8
-```
8
+```text
9 9
 jefblpepre
10 10
 camdcimgtc
11 11
 oivokprjsm

+ 0
- 5
exercises/wordy/README.md Просмотреть файл

@@ -2,7 +2,6 @@
2 2
 
3 3
 Parse and evaluate simple math word problems returning the answer as an integer.
4 4
 
5
-
6 5
 ## Iteration 1 — Addition
7 6
 
8 7
 Add two numbers together.
@@ -13,7 +12,6 @@ Evaluates to 18.
13 12
 
14 13
 Handle large numbers and negative numbers.
15 14
 
16
-
17 15
 ## Iteration 2 — Subtraction, Multiplication and Division
18 16
 
19 17
 Now, perform the other three operations.
@@ -30,7 +28,6 @@ Now, perform the other three operations.
30 28
 
31 29
 5
32 30
 
33
-
34 31
 ## Iteration 3 — Multiple Operations
35 32
 
36 33
 Handle a set of operations, in sequence.
@@ -46,7 +43,6 @@ left-to-right, _ignoring the typical order of operations._
46 43
 
47 44
 15  (i.e. not 9)
48 45
 
49
-
50 46
 ## Bonus — Exponentials
51 47
 
52 48
 If you'd like, handle exponentials.
@@ -56,7 +52,6 @@ If you'd like, handle exponentials.
56 52
 32
57 53
 
58 54
 
59
-
60 55
 To run the tests:
61 56
 
62 57
 ```sh