Просмотр исходного кода

Merge pull request #694 from exercism/generate-readme

Generate exercise READMEs from templates
Logan Stucki 9 лет назад
Родитель
Сommit
e03b1e4e05
100 измененных файлов: 3477 добавлений и 0 удалений
  1. 17
    0
      exercises/accumulate/.meta/readme.go.tmpl
  2. 47
    0
      exercises/accumulate/README.md
  3. 17
    0
      exercises/acronym/.meta/readme.go.tmpl
  4. 27
    0
      exercises/acronym/README.md
  5. 17
    0
      exercises/all-your-base/.meta/readme.go.tmpl
  6. 47
    0
      exercises/all-your-base/README.md
  7. 17
    0
      exercises/allergies/.meta/readme.go.tmpl
  8. 49
    0
      exercises/allergies/README.md
  9. 17
    0
      exercises/anagram/.meta/readme.go.tmpl
  10. 25
    0
      exercises/anagram/README.md
  11. 17
    0
      exercises/atbash-cipher/.meta/readme.go.tmpl
  12. 46
    0
      exercises/atbash-cipher/README.md
  13. 17
    0
      exercises/bank-account/.meta/readme.go.tmpl
  14. 54
    0
      exercises/bank-account/README.md
  15. 17
    0
      exercises/beer-song/.meta/readme.go.tmpl
  16. 339
    0
      exercises/beer-song/README.md
  17. 17
    0
      exercises/binary-search-tree/.meta/readme.go.tmpl
  18. 72
    0
      exercises/binary-search-tree/README.md
  19. 17
    0
      exercises/binary-search/.meta/readme.go.tmpl
  20. 53
    0
      exercises/binary-search/README.md
  21. 17
    0
      exercises/binary/.meta/readme.go.tmpl
  22. 47
    0
      exercises/binary/README.md
  23. 17
    0
      exercises/bob/.meta/readme.go.tmpl
  24. 30
    0
      exercises/bob/README.md
  25. 17
    0
      exercises/book-store/.meta/readme.go.tmpl
  26. 86
    0
      exercises/book-store/README.md
  27. 17
    0
      exercises/bowling/.meta/readme.go.tmpl
  28. 65
    0
      exercises/bowling/README.md
  29. 17
    0
      exercises/bracket-push/.meta/readme.go.tmpl
  30. 22
    0
      exercises/bracket-push/README.md
  31. 17
    0
      exercises/change/.meta/readme.go.tmpl
  32. 35
    0
      exercises/change/README.md
  33. 17
    0
      exercises/circular-buffer/.meta/readme.go.tmpl
  34. 62
    0
      exercises/circular-buffer/README.md
  35. 17
    0
      exercises/clock/.meta/readme.go.tmpl
  36. 30
    0
      exercises/clock/README.md
  37. 17
    0
      exercises/collatz-conjecture/.meta/readme.go.tmpl
  38. 45
    0
      exercises/collatz-conjecture/README.md
  39. 17
    0
      exercises/complex-numbers/.meta/readme.go.tmpl
  40. 23
    0
      exercises/complex-numbers/README.md
  41. 17
    0
      exercises/crypto-square/.meta/readme.go.tmpl
  42. 86
    0
      exercises/crypto-square/README.md
  43. 17
    0
      exercises/custom-set/.meta/readme.go.tmpl
  44. 23
    0
      exercises/custom-set/README.md
  45. 17
    0
      exercises/diamond/.meta/readme.go.tmpl
  46. 71
    0
      exercises/diamond/README.md
  47. 17
    0
      exercises/difference-of-squares/.meta/readme.go.tmpl
  48. 31
    0
      exercises/difference-of-squares/README.md
  49. 17
    0
      exercises/etl/.meta/readme.go.tmpl
  50. 63
    0
      exercises/etl/README.md
  51. 17
    0
      exercises/flatten-array/.meta/readme.go.tmpl
  52. 30
    0
      exercises/flatten-array/README.md
  53. 17
    0
      exercises/food-chain/.meta/readme.go.tmpl
  54. 82
    0
      exercises/food-chain/README.md
  55. 17
    0
      exercises/gigasecond/.meta/readme.go.tmpl
  56. 23
    0
      exercises/gigasecond/README.md
  57. 17
    0
      exercises/grade-school/.meta/readme.go.tmpl
  58. 54
    0
      exercises/grade-school/README.md
  59. 17
    0
      exercises/hamming/.meta/readme.go.tmpl
  60. 68
    0
      exercises/hamming/README.md
  61. 17
    0
      exercises/hello-world/.meta/readme.go.tmpl
  62. 39
    0
      exercises/hello-world/README.md
  63. 17
    0
      exercises/hexadecimal/.meta/readme.go.tmpl
  64. 26
    0
      exercises/hexadecimal/README.md
  65. 17
    0
      exercises/isogram/.meta/readme.go.tmpl
  66. 42
    0
      exercises/isogram/README.md
  67. 17
    0
      exercises/kindergarten-garden/.meta/readme.go.tmpl
  68. 78
    0
      exercises/kindergarten-garden/README.md
  69. 17
    0
      exercises/largest-series-product/.meta/readme.go.tmpl
  70. 32
    0
      exercises/largest-series-product/README.md
  71. 17
    0
      exercises/linked-list/.meta/readme.go.tmpl
  72. 46
    0
      exercises/linked-list/README.md
  73. 17
    0
      exercises/list-ops/.meta/readme.go.tmpl
  74. 27
    0
      exercises/list-ops/README.md
  75. 17
    0
      exercises/luhn/.meta/readme.go.tmpl
  76. 83
    0
      exercises/luhn/README.md
  77. 17
    0
      exercises/matrix/.meta/readme.go.tmpl
  78. 57
    0
      exercises/matrix/README.md
  79. 17
    0
      exercises/meetup/.meta/readme.go.tmpl
  80. 42
    0
      exercises/meetup/README.md
  81. 17
    0
      exercises/minesweeper/.meta/readme.go.tmpl
  82. 42
    0
      exercises/minesweeper/README.md
  83. 17
    0
      exercises/nth-prime/.meta/readme.go.tmpl
  84. 27
    0
      exercises/nth-prime/README.md
  85. 17
    0
      exercises/nucleotide-count/.meta/readme.go.tmpl
  86. 45
    0
      exercises/nucleotide-count/README.md
  87. 17
    0
      exercises/ocr-numbers/.meta/readme.go.tmpl
  88. 97
    0
      exercises/ocr-numbers/README.md
  89. 17
    0
      exercises/octal/.meta/readme.go.tmpl
  90. 61
    0
      exercises/octal/README.md
  91. 17
    0
      exercises/palindrome-products/.meta/readme.go.tmpl
  92. 52
    0
      exercises/palindrome-products/README.md
  93. 17
    0
      exercises/pangram/.meta/readme.go.tmpl
  94. 27
    0
      exercises/pangram/README.md
  95. 17
    0
      exercises/pascals-triangle/.meta/readme.go.tmpl
  96. 33
    0
      exercises/pascals-triangle/README.md
  97. 17
    0
      exercises/perfect-numbers/.meta/readme.go.tmpl
  98. 36
    0
      exercises/perfect-numbers/README.md
  99. 17
    0
      exercises/phone-number/.meta/readme.go.tmpl
  100. 0
    0
      exercises/phone-number/README.md

+ 17
- 0
exercises/accumulate/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,47 @@
1
+# Accumulate
2
+
3
+Implement the `accumulate` operation, which, given a collection and an
4
+operation to perform on each element of the collection, returns a new
5
+collection containing the result of applying that operation to each element of
6
+the input collection.
7
+
8
+Given the collection of numbers:
9
+
10
+- 1, 2, 3, 4, 5
11
+
12
+And the operation:
13
+
14
+- square a number (`x => x * x`)
15
+
16
+Your code should be able to produce the collection of squares:
17
+
18
+- 1, 4, 9, 16, 25
19
+
20
+Check out the test suite to see the expected function signature.
21
+
22
+## Restrictions
23
+
24
+Keep your hands off that collect/map/fmap/whatchamacallit functionality
25
+provided by your standard library!
26
+Solve this one yourself using other basic tools instead.
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
+
32
+To run the tests:
33
+
34
+```sh
35
+$ gradle test
36
+```
37
+
38
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
39
+
40
+
41
+## Source
42
+
43
+Conversation with James Edward Gray II [https://twitter.com/jeg2](https://twitter.com/jeg2)
44
+
45
+## Submitting Incomplete Solutions
46
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
47
+

+ 17
- 0
exercises/acronym/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,27 @@
1
+# Acronym
2
+
3
+Convert a phrase to its acronym.
4
+
5
+Techies love their TLA (Three Letter Acronyms)!
6
+
7
+Help generate some jargon by writing a program that converts a long name
8
+like Portable Network Graphics to its acronym (PNG).
9
+
10
+
11
+
12
+To run the tests:
13
+
14
+```sh
15
+$ gradle test
16
+```
17
+
18
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
19
+
20
+
21
+## Source
22
+
23
+Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc)
24
+
25
+## Submitting Incomplete Solutions
26
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
27
+

+ 17
- 0
exercises/all-your-base/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,47 @@
1
+# All Your Base
2
+
3
+Convert a number, represented as a sequence of digits in one base, to any other base.
4
+
5
+Implement general base conversion. Given a number in base **a**,
6
+represented as a sequence of digits, convert it to base **b**.
7
+
8
+## Note
9
+- Try to implement the conversion yourself.
10
+  Do not use something else to perform the conversion for you.
11
+
12
+## About [Positional Notation](https://en.wikipedia.org/wiki/Positional_notation)
13
+
14
+In positional notation, a number in base **b** can be understood as a linear
15
+combination of powers of **b**.
16
+
17
+The number 42, *in base 10*, means:
18
+
19
+(4 * 10^1) + (2 * 10^0)
20
+
21
+The number 101010, *in base 2*, means:
22
+
23
+(1 * 2^5) + (0 * 2^4) + (1 * 2^3) + (0 * 2^2) + (1 * 2^1) + (0 * 2^0)
24
+
25
+The number 1120, *in base 3*, means:
26
+
27
+(1 * 3^3) + (1 * 3^2) + (2 * 3^1) + (0 * 3^0)
28
+
29
+I think you got the idea!
30
+
31
+
32
+*Yes. Those three numbers above are exactly the same. Congratulations!*
33
+
34
+
35
+To run the tests:
36
+
37
+```sh
38
+$ gradle test
39
+```
40
+
41
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
42
+
43
+
44
+
45
+## Submitting Incomplete Solutions
46
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
47
+

+ 17
- 0
exercises/allergies/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,49 @@
1
+# Allergies
2
+
3
+Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.
4
+
5
+An allergy test produces a single numeric score which contains the
6
+information about all the allergies the person has (that they were
7
+tested for).
8
+
9
+The list of items (and their value) that were tested are:
10
+
11
+* eggs (1)
12
+* peanuts (2)
13
+* shellfish (4)
14
+* strawberries (8)
15
+* tomatoes (16)
16
+* chocolate (32)
17
+* pollen (64)
18
+* cats (128)
19
+
20
+So if Tom is allergic to peanuts and chocolate, he gets a score of 34.
21
+
22
+Now, given just that score of 34, your program should be able to say:
23
+
24
+- Whether Tom is allergic to any one of those allergens listed above.
25
+- All the allergens Tom is allergic to.
26
+
27
+Note: a given score may include allergens **not** listed above (i.e.
28
+allergens that score 256, 512, 1024, etc.).  Your program should
29
+ignore those components of the score.  For example, if the allergy
30
+score is 257, your program should only report the eggs (1) allergy.
31
+
32
+
33
+
34
+To run the tests:
35
+
36
+```sh
37
+$ gradle test
38
+```
39
+
40
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
41
+
42
+
43
+## Source
44
+
45
+Jumpstart Lab Warm-up [http://jumpstartlab.com](http://jumpstartlab.com)
46
+
47
+## Submitting Incomplete Solutions
48
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
49
+

+ 17
- 0
exercises/anagram/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,25 @@
1
+# Anagram
2
+
3
+Given a word and a list of possible anagrams, select the correct sublist.
4
+
5
+Given `"listen"` and a list of candidates like `"enlists" "google"
6
+"inlets" "banana"` the program should return a list containing
7
+`"inlets"`.
8
+
9
+
10
+To run the tests:
11
+
12
+```sh
13
+$ gradle test
14
+```
15
+
16
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
17
+
18
+
19
+## Source
20
+
21
+Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup)
22
+
23
+## Submitting Incomplete Solutions
24
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
25
+

+ 17
- 0
exercises/atbash-cipher/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,46 @@
1
+# Atbash Cipher
2
+
3
+Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
4
+
5
+The Atbash cipher is a simple substitution cipher that relies on
6
+transposing all the letters in the alphabet such that the resulting
7
+alphabet is backwards. The first letter is replaced with the last
8
+letter, the second with the second-last, and so on.
9
+
10
+An Atbash cipher for the Latin alphabet would be as follows:
11
+
12
+```plain
13
+Plain:  abcdefghijklmnopqrstuvwxyz
14
+Cipher: zyxwvutsrqponmlkjihgfedcba
15
+```
16
+
17
+It is a very weak cipher because it only has one possible key, and it is
18
+a simple monoalphabetic substitution cipher. However, this may not have
19
+been an issue in the cipher's time.
20
+
21
+Ciphertext is written out in groups of fixed length, the traditional group size
22
+being 5 letters, and punctuation is excluded. This is to make it harder to guess
23
+things based on word boundaries.
24
+
25
+## Examples
26
+- Encoding `test` gives `gvhg`
27
+- Decoding `gvhg` gives `test`
28
+- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`
29
+
30
+
31
+To run the tests:
32
+
33
+```sh
34
+$ gradle test
35
+```
36
+
37
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
38
+
39
+
40
+## Source
41
+
42
+Wikipedia [http://en.wikipedia.org/wiki/Atbash](http://en.wikipedia.org/wiki/Atbash)
43
+
44
+## Submitting Incomplete Solutions
45
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
46
+

+ 17
- 0
exercises/bank-account/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,54 @@
1
+# Bank Account
2
+
3
+Simulate a bank account supporting opening/closing, withdrawals, and deposits
4
+of money. Watch out for concurrent transactions!
5
+
6
+A bank account can be accessed in multiple ways. Clients can make
7
+deposits and withdrawals using the internet, mobile phones, etc. Shops
8
+can charge against the account.
9
+
10
+Create an account that can be accessed from multiple threads/processes
11
+(terminology depends on your programming language).
12
+
13
+It should be possible to close an account; operations against a closed
14
+account must fail.
15
+
16
+## Instructions
17
+
18
+Run the test file, and fix each of the errors in turn. When you get the
19
+first test to pass, go to the first pending or skipped test, and make
20
+that pass as well. When all of the tests are passing, feel free to
21
+submit.
22
+
23
+Remember that passing code is just the first step. The goal is to work
24
+towards a solution that is as readable and expressive as you can make
25
+it.
26
+
27
+Have fun!
28
+
29
+This exercise introduces [concurrency](https://docs.oracle.com/javase/tutorial/essential/concurrency/index.html). 
30
+To pass the last test you might find the 
31
+[`synchronized` keyword or locks](https://docs.oracle.com/javase/tutorial/essential/concurrency/locksync.html) useful.
32
+
33
+Problems arising from running code concurrently are often intermittent because they depend on the order the code is
34
+executed. Therefore the last test runs many [threads](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html) 
35
+several times to increase the chances of catching a bug. That means this test should fail if your implementation is not
36
+[thread safe](https://en.wikipedia.org/wiki/Thread_safety), but there is a chance it will pass just because there was 
37
+no concurrent modification attempt. It is unlikely that this will occur several times 
38
+in a row since the order the code is executed should vary every time you run the test. So if you run the last test a 
39
+couple of times and it passes every time then you can be reasonably sure that your implementation is correct.
40
+
41
+
42
+To run the tests:
43
+
44
+```sh
45
+$ gradle test
46
+```
47
+
48
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
49
+
50
+
51
+
52
+## Submitting Incomplete Solutions
53
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
54
+

+ 17
- 0
exercises/beer-song/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,339 @@
1
+# Beer Song
2
+
3
+Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
4
+
5
+Note that not all verses are identical.
6
+
7
+```plain
8
+99 bottles of beer on the wall, 99 bottles of beer.
9
+Take one down and pass it around, 98 bottles of beer on the wall.
10
+
11
+98 bottles of beer on the wall, 98 bottles of beer.
12
+Take one down and pass it around, 97 bottles of beer on the wall.
13
+
14
+97 bottles of beer on the wall, 97 bottles of beer.
15
+Take one down and pass it around, 96 bottles of beer on the wall.
16
+
17
+96 bottles of beer on the wall, 96 bottles of beer.
18
+Take one down and pass it around, 95 bottles of beer on the wall.
19
+
20
+95 bottles of beer on the wall, 95 bottles of beer.
21
+Take one down and pass it around, 94 bottles of beer on the wall.
22
+
23
+94 bottles of beer on the wall, 94 bottles of beer.
24
+Take one down and pass it around, 93 bottles of beer on the wall.
25
+
26
+93 bottles of beer on the wall, 93 bottles of beer.
27
+Take one down and pass it around, 92 bottles of beer on the wall.
28
+
29
+92 bottles of beer on the wall, 92 bottles of beer.
30
+Take one down and pass it around, 91 bottles of beer on the wall.
31
+
32
+91 bottles of beer on the wall, 91 bottles of beer.
33
+Take one down and pass it around, 90 bottles of beer on the wall.
34
+
35
+90 bottles of beer on the wall, 90 bottles of beer.
36
+Take one down and pass it around, 89 bottles of beer on the wall.
37
+
38
+89 bottles of beer on the wall, 89 bottles of beer.
39
+Take one down and pass it around, 88 bottles of beer on the wall.
40
+
41
+88 bottles of beer on the wall, 88 bottles of beer.
42
+Take one down and pass it around, 87 bottles of beer on the wall.
43
+
44
+87 bottles of beer on the wall, 87 bottles of beer.
45
+Take one down and pass it around, 86 bottles of beer on the wall.
46
+
47
+86 bottles of beer on the wall, 86 bottles of beer.
48
+Take one down and pass it around, 85 bottles of beer on the wall.
49
+
50
+85 bottles of beer on the wall, 85 bottles of beer.
51
+Take one down and pass it around, 84 bottles of beer on the wall.
52
+
53
+84 bottles of beer on the wall, 84 bottles of beer.
54
+Take one down and pass it around, 83 bottles of beer on the wall.
55
+
56
+83 bottles of beer on the wall, 83 bottles of beer.
57
+Take one down and pass it around, 82 bottles of beer on the wall.
58
+
59
+82 bottles of beer on the wall, 82 bottles of beer.
60
+Take one down and pass it around, 81 bottles of beer on the wall.
61
+
62
+81 bottles of beer on the wall, 81 bottles of beer.
63
+Take one down and pass it around, 80 bottles of beer on the wall.
64
+
65
+80 bottles of beer on the wall, 80 bottles of beer.
66
+Take one down and pass it around, 79 bottles of beer on the wall.
67
+
68
+79 bottles of beer on the wall, 79 bottles of beer.
69
+Take one down and pass it around, 78 bottles of beer on the wall.
70
+
71
+78 bottles of beer on the wall, 78 bottles of beer.
72
+Take one down and pass it around, 77 bottles of beer on the wall.
73
+
74
+77 bottles of beer on the wall, 77 bottles of beer.
75
+Take one down and pass it around, 76 bottles of beer on the wall.
76
+
77
+76 bottles of beer on the wall, 76 bottles of beer.
78
+Take one down and pass it around, 75 bottles of beer on the wall.
79
+
80
+75 bottles of beer on the wall, 75 bottles of beer.
81
+Take one down and pass it around, 74 bottles of beer on the wall.
82
+
83
+74 bottles of beer on the wall, 74 bottles of beer.
84
+Take one down and pass it around, 73 bottles of beer on the wall.
85
+
86
+73 bottles of beer on the wall, 73 bottles of beer.
87
+Take one down and pass it around, 72 bottles of beer on the wall.
88
+
89
+72 bottles of beer on the wall, 72 bottles of beer.
90
+Take one down and pass it around, 71 bottles of beer on the wall.
91
+
92
+71 bottles of beer on the wall, 71 bottles of beer.
93
+Take one down and pass it around, 70 bottles of beer on the wall.
94
+
95
+70 bottles of beer on the wall, 70 bottles of beer.
96
+Take one down and pass it around, 69 bottles of beer on the wall.
97
+
98
+69 bottles of beer on the wall, 69 bottles of beer.
99
+Take one down and pass it around, 68 bottles of beer on the wall.
100
+
101
+68 bottles of beer on the wall, 68 bottles of beer.
102
+Take one down and pass it around, 67 bottles of beer on the wall.
103
+
104
+67 bottles of beer on the wall, 67 bottles of beer.
105
+Take one down and pass it around, 66 bottles of beer on the wall.
106
+
107
+66 bottles of beer on the wall, 66 bottles of beer.
108
+Take one down and pass it around, 65 bottles of beer on the wall.
109
+
110
+65 bottles of beer on the wall, 65 bottles of beer.
111
+Take one down and pass it around, 64 bottles of beer on the wall.
112
+
113
+64 bottles of beer on the wall, 64 bottles of beer.
114
+Take one down and pass it around, 63 bottles of beer on the wall.
115
+
116
+63 bottles of beer on the wall, 63 bottles of beer.
117
+Take one down and pass it around, 62 bottles of beer on the wall.
118
+
119
+62 bottles of beer on the wall, 62 bottles of beer.
120
+Take one down and pass it around, 61 bottles of beer on the wall.
121
+
122
+61 bottles of beer on the wall, 61 bottles of beer.
123
+Take one down and pass it around, 60 bottles of beer on the wall.
124
+
125
+60 bottles of beer on the wall, 60 bottles of beer.
126
+Take one down and pass it around, 59 bottles of beer on the wall.
127
+
128
+59 bottles of beer on the wall, 59 bottles of beer.
129
+Take one down and pass it around, 58 bottles of beer on the wall.
130
+
131
+58 bottles of beer on the wall, 58 bottles of beer.
132
+Take one down and pass it around, 57 bottles of beer on the wall.
133
+
134
+57 bottles of beer on the wall, 57 bottles of beer.
135
+Take one down and pass it around, 56 bottles of beer on the wall.
136
+
137
+56 bottles of beer on the wall, 56 bottles of beer.
138
+Take one down and pass it around, 55 bottles of beer on the wall.
139
+
140
+55 bottles of beer on the wall, 55 bottles of beer.
141
+Take one down and pass it around, 54 bottles of beer on the wall.
142
+
143
+54 bottles of beer on the wall, 54 bottles of beer.
144
+Take one down and pass it around, 53 bottles of beer on the wall.
145
+
146
+53 bottles of beer on the wall, 53 bottles of beer.
147
+Take one down and pass it around, 52 bottles of beer on the wall.
148
+
149
+52 bottles of beer on the wall, 52 bottles of beer.
150
+Take one down and pass it around, 51 bottles of beer on the wall.
151
+
152
+51 bottles of beer on the wall, 51 bottles of beer.
153
+Take one down and pass it around, 50 bottles of beer on the wall.
154
+
155
+50 bottles of beer on the wall, 50 bottles of beer.
156
+Take one down and pass it around, 49 bottles of beer on the wall.
157
+
158
+49 bottles of beer on the wall, 49 bottles of beer.
159
+Take one down and pass it around, 48 bottles of beer on the wall.
160
+
161
+48 bottles of beer on the wall, 48 bottles of beer.
162
+Take one down and pass it around, 47 bottles of beer on the wall.
163
+
164
+47 bottles of beer on the wall, 47 bottles of beer.
165
+Take one down and pass it around, 46 bottles of beer on the wall.
166
+
167
+46 bottles of beer on the wall, 46 bottles of beer.
168
+Take one down and pass it around, 45 bottles of beer on the wall.
169
+
170
+45 bottles of beer on the wall, 45 bottles of beer.
171
+Take one down and pass it around, 44 bottles of beer on the wall.
172
+
173
+44 bottles of beer on the wall, 44 bottles of beer.
174
+Take one down and pass it around, 43 bottles of beer on the wall.
175
+
176
+43 bottles of beer on the wall, 43 bottles of beer.
177
+Take one down and pass it around, 42 bottles of beer on the wall.
178
+
179
+42 bottles of beer on the wall, 42 bottles of beer.
180
+Take one down and pass it around, 41 bottles of beer on the wall.
181
+
182
+41 bottles of beer on the wall, 41 bottles of beer.
183
+Take one down and pass it around, 40 bottles of beer on the wall.
184
+
185
+40 bottles of beer on the wall, 40 bottles of beer.
186
+Take one down and pass it around, 39 bottles of beer on the wall.
187
+
188
+39 bottles of beer on the wall, 39 bottles of beer.
189
+Take one down and pass it around, 38 bottles of beer on the wall.
190
+
191
+38 bottles of beer on the wall, 38 bottles of beer.
192
+Take one down and pass it around, 37 bottles of beer on the wall.
193
+
194
+37 bottles of beer on the wall, 37 bottles of beer.
195
+Take one down and pass it around, 36 bottles of beer on the wall.
196
+
197
+36 bottles of beer on the wall, 36 bottles of beer.
198
+Take one down and pass it around, 35 bottles of beer on the wall.
199
+
200
+35 bottles of beer on the wall, 35 bottles of beer.
201
+Take one down and pass it around, 34 bottles of beer on the wall.
202
+
203
+34 bottles of beer on the wall, 34 bottles of beer.
204
+Take one down and pass it around, 33 bottles of beer on the wall.
205
+
206
+33 bottles of beer on the wall, 33 bottles of beer.
207
+Take one down and pass it around, 32 bottles of beer on the wall.
208
+
209
+32 bottles of beer on the wall, 32 bottles of beer.
210
+Take one down and pass it around, 31 bottles of beer on the wall.
211
+
212
+31 bottles of beer on the wall, 31 bottles of beer.
213
+Take one down and pass it around, 30 bottles of beer on the wall.
214
+
215
+30 bottles of beer on the wall, 30 bottles of beer.
216
+Take one down and pass it around, 29 bottles of beer on the wall.
217
+
218
+29 bottles of beer on the wall, 29 bottles of beer.
219
+Take one down and pass it around, 28 bottles of beer on the wall.
220
+
221
+28 bottles of beer on the wall, 28 bottles of beer.
222
+Take one down and pass it around, 27 bottles of beer on the wall.
223
+
224
+27 bottles of beer on the wall, 27 bottles of beer.
225
+Take one down and pass it around, 26 bottles of beer on the wall.
226
+
227
+26 bottles of beer on the wall, 26 bottles of beer.
228
+Take one down and pass it around, 25 bottles of beer on the wall.
229
+
230
+25 bottles of beer on the wall, 25 bottles of beer.
231
+Take one down and pass it around, 24 bottles of beer on the wall.
232
+
233
+24 bottles of beer on the wall, 24 bottles of beer.
234
+Take one down and pass it around, 23 bottles of beer on the wall.
235
+
236
+23 bottles of beer on the wall, 23 bottles of beer.
237
+Take one down and pass it around, 22 bottles of beer on the wall.
238
+
239
+22 bottles of beer on the wall, 22 bottles of beer.
240
+Take one down and pass it around, 21 bottles of beer on the wall.
241
+
242
+21 bottles of beer on the wall, 21 bottles of beer.
243
+Take one down and pass it around, 20 bottles of beer on the wall.
244
+
245
+20 bottles of beer on the wall, 20 bottles of beer.
246
+Take one down and pass it around, 19 bottles of beer on the wall.
247
+
248
+19 bottles of beer on the wall, 19 bottles of beer.
249
+Take one down and pass it around, 18 bottles of beer on the wall.
250
+
251
+18 bottles of beer on the wall, 18 bottles of beer.
252
+Take one down and pass it around, 17 bottles of beer on the wall.
253
+
254
+17 bottles of beer on the wall, 17 bottles of beer.
255
+Take one down and pass it around, 16 bottles of beer on the wall.
256
+
257
+16 bottles of beer on the wall, 16 bottles of beer.
258
+Take one down and pass it around, 15 bottles of beer on the wall.
259
+
260
+15 bottles of beer on the wall, 15 bottles of beer.
261
+Take one down and pass it around, 14 bottles of beer on the wall.
262
+
263
+14 bottles of beer on the wall, 14 bottles of beer.
264
+Take one down and pass it around, 13 bottles of beer on the wall.
265
+
266
+13 bottles of beer on the wall, 13 bottles of beer.
267
+Take one down and pass it around, 12 bottles of beer on the wall.
268
+
269
+12 bottles of beer on the wall, 12 bottles of beer.
270
+Take one down and pass it around, 11 bottles of beer on the wall.
271
+
272
+11 bottles of beer on the wall, 11 bottles of beer.
273
+Take one down and pass it around, 10 bottles of beer on the wall.
274
+
275
+10 bottles of beer on the wall, 10 bottles of beer.
276
+Take one down and pass it around, 9 bottles of beer on the wall.
277
+
278
+9 bottles of beer on the wall, 9 bottles of beer.
279
+Take one down and pass it around, 8 bottles of beer on the wall.
280
+
281
+8 bottles of beer on the wall, 8 bottles of beer.
282
+Take one down and pass it around, 7 bottles of beer on the wall.
283
+
284
+7 bottles of beer on the wall, 7 bottles of beer.
285
+Take one down and pass it around, 6 bottles of beer on the wall.
286
+
287
+6 bottles of beer on the wall, 6 bottles of beer.
288
+Take one down and pass it around, 5 bottles of beer on the wall.
289
+
290
+5 bottles of beer on the wall, 5 bottles of beer.
291
+Take one down and pass it around, 4 bottles of beer on the wall.
292
+
293
+4 bottles of beer on the wall, 4 bottles of beer.
294
+Take one down and pass it around, 3 bottles of beer on the wall.
295
+
296
+3 bottles of beer on the wall, 3 bottles of beer.
297
+Take one down and pass it around, 2 bottles of beer on the wall.
298
+
299
+2 bottles of beer on the wall, 2 bottles of beer.
300
+Take one down and pass it around, 1 bottle of beer on the wall.
301
+
302
+1 bottle of beer on the wall, 1 bottle of beer.
303
+Take it down and pass it around, no more bottles of beer on the wall.
304
+
305
+No more bottles of beer on the wall, no more bottles of beer.
306
+Go to the store and buy some more, 99 bottles of beer on the wall.
307
+```
308
+
309
+## For bonus points
310
+
311
+Did you get the tests passing and the code clean? If you want to, these
312
+are some additional things you could try:
313
+
314
+* Remove as much duplication as you possibly can.
315
+* Optimize for readability, even if it means introducing duplication.
316
+* If you've removed all the duplication, do you have a lot of
317
+  conditionals? Try replacing the conditionals with polymorphism, if it
318
+  applies in this language. How readable is it?
319
+
320
+Then please share your thoughts in a comment on the submission. Did this
321
+experiment make the code better? Worse? Did you learn anything from it?
322
+
323
+
324
+To run the tests:
325
+
326
+```sh
327
+$ gradle test
328
+```
329
+
330
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
331
+
332
+
333
+## Source
334
+
335
+Learn to Program by Chris Pine [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)
336
+
337
+## Submitting Incomplete Solutions
338
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
339
+

+ 17
- 0
exercises/binary-search-tree/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,72 @@
1
+# Binary Search Tree
2
+
3
+Insert and search for numbers in a binary tree.
4
+
5
+When we need to represent sorted data, an array does not make a good
6
+data structure.
7
+
8
+Say we have the array `[1, 3, 4, 5]`, and we add 2 to it so it becomes
9
+`[1, 3, 4, 5, 2]` now we must sort the entire array again! We can
10
+improve on this by realizing that we only need to make space for the new
11
+item `[1, nil, 3, 4, 5]`, and then adding the item in the space we
12
+added. But this still requires us to shift many elements down by one.
13
+
14
+Binary Search Trees, however, can operate on sorted data much more
15
+efficiently.
16
+
17
+A binary search tree consists of a series of connected nodes. Each node
18
+contains a piece of data (e.g. the number 3), a variable named `left`,
19
+and a variable named `right`. The `left` and `right` variables point at
20
+`nil`, or other nodes. Since these other nodes in turn have other nodes
21
+beneath them, we say that the left and right variables are pointing at
22
+subtrees. All data in the left subtree is less than or equal to the
23
+current node's data, and all data in the right subtree is greater than
24
+the current node's data.
25
+
26
+For example, if we had a node containing the data 4, and we added the
27
+data 2, our tree would look like this:
28
+
29
+      4
30
+     /
31
+    2
32
+
33
+If we then added 6, it would look like this:
34
+
35
+      4
36
+     / \
37
+    2   6
38
+
39
+If we then added 3, it would look like this
40
+
41
+       4
42
+     /   \
43
+    2     6
44
+     \
45
+      3
46
+
47
+And if we then added 1, 5, and 7, it would look like this
48
+
49
+          4
50
+        /   \
51
+       /     \
52
+      2       6
53
+     / \     / \
54
+    1   3   5   7
55
+
56
+
57
+To run the tests:
58
+
59
+```sh
60
+$ gradle test
61
+```
62
+
63
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
64
+
65
+
66
+## Source
67
+
68
+Josh Cheek [https://twitter.com/josh_cheek](https://twitter.com/josh_cheek)
69
+
70
+## Submitting Incomplete Solutions
71
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
72
+

+ 17
- 0
exercises/binary-search/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,53 @@
1
+# Binary Search
2
+
3
+Implement a binary search algorithm.
4
+
5
+Searching a sorted collection is a common task. A dictionary is a sorted
6
+list of word definitions. Given a word, one can find its definition. A
7
+telephone book is a sorted list of people's names, addresses, and
8
+telephone numbers. Knowing someone's name allows one to quickly find
9
+their telephone number and address.
10
+
11
+If the list to be searched contains more than a few items (a dozen, say)
12
+a binary search will require far fewer comparisons than a linear search,
13
+but it imposes the requirement that the list be sorted.
14
+
15
+In computer science, a binary search or half-interval search algorithm
16
+finds the position of a specified input value (the search "key") within
17
+an array sorted by key value.
18
+
19
+In each step, the algorithm compares the search key value with the key
20
+value of the middle element of the array.
21
+
22
+If the keys match, then a matching element has been found and its index,
23
+or position, is returned.
24
+
25
+Otherwise, if the search key is less than the middle element's key, then
26
+the algorithm repeats its action on the sub-array to the left of the
27
+middle element or, if the search key is greater, on the sub-array to the
28
+right.
29
+
30
+If the remaining array to be searched is empty, then the key cannot be
31
+found in the array and a special "not found" indication is returned.
32
+
33
+A binary search halves the number of items to check with each iteration,
34
+so locating an item (or determining its absence) takes logarithmic time.
35
+A binary search is a dichotomic divide and conquer search algorithm.
36
+
37
+
38
+To run the tests:
39
+
40
+```sh
41
+$ gradle test
42
+```
43
+
44
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
45
+
46
+
47
+## Source
48
+
49
+Wikipedia [http://en.wikipedia.org/wiki/Binary_search_algorithm](http://en.wikipedia.org/wiki/Binary_search_algorithm)
50
+
51
+## Submitting Incomplete Solutions
52
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
53
+

+ 17
- 0
exercises/binary/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,47 @@
1
+# Binary
2
+
3
+Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles.
4
+
5
+Implement binary to decimal conversion. Given a binary input
6
+string, your program should produce a decimal output. The
7
+program should handle invalid inputs.
8
+
9
+## Note
10
+- Implement the conversion yourself.
11
+  Do not use something else to perform the conversion for you.
12
+
13
+## About Binary (Base-2)
14
+Decimal is a base-10 system.
15
+
16
+A number 23 in base 10 notation can be understood
17
+as a linear combination of powers of 10:
18
+
19
+- The rightmost digit gets multiplied by 10^0 = 1
20
+- The next number gets multiplied by 10^1 = 10
21
+- ...
22
+- The *n*th number gets multiplied by 10^*(n-1)*.
23
+- All these values are summed.
24
+
25
+So: `23 => 2*10^1 + 3*10^0 => 2*10 + 3*1 = 23 base 10`
26
+
27
+Binary is similar, but uses powers of 2 rather than powers of 10.
28
+
29
+So: `101 => 1*2^2 + 0*2^1 + 1*2^0 => 1*4 + 0*2 + 1*1 => 4 + 1 => 5 base 10`.
30
+
31
+
32
+To run the tests:
33
+
34
+```sh
35
+$ gradle test
36
+```
37
+
38
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
39
+
40
+
41
+## Source
42
+
43
+All of Computer Science [http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-](http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-)
44
+
45
+## Submitting Incomplete Solutions
46
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
47
+

+ 17
- 0
exercises/bob/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,30 @@
1
+# Bob
2
+
3
+Bob is a lackadaisical teenager. In conversation, his responses are very limited.
4
+
5
+Bob answers 'Sure.' if you ask him a question.
6
+
7
+He answers 'Whoa, chill out!' if you yell at him.
8
+
9
+He says 'Fine. Be that way!' if you address him without actually saying
10
+anything.
11
+
12
+He answers 'Whatever.' to anything else.
13
+
14
+
15
+To run the tests:
16
+
17
+```sh
18
+$ gradle test
19
+```
20
+
21
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
22
+
23
+
24
+## Source
25
+
26
+Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)
27
+
28
+## Submitting Incomplete Solutions
29
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
30
+

+ 17
- 0
exercises/book-store/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,86 @@
1
+# Book Store
2
+
3
+To try and encourage more sales of different books from a popular 5 book
4
+series, a bookshop has decided to offer discounts on multiple book purchases.
5
+
6
+One copy of any of the five books costs $8. 
7
+
8
+If, however, you buy two different books, you get a 5%
9
+discount on those two books.
10
+
11
+If you buy 3 different books, you get a 10% discount. 
12
+
13
+If you buy 4 different books, you get a 20% discount.
14
+
15
+If you buy all 5, you get a 25% discount. 
16
+
17
+Note: that if you buy four books, of which 3 are
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. 
20
+
21
+Your mission is to write a piece of code to calculate the
22
+price of any conceivable shopping basket (containing only
23
+books of the same series), giving as big a discount as
24
+possible.
25
+
26
+For example, how much does this basket of books cost?
27
+
28
+- 2 copies of the first book
29
+- 2 copies of the second book
30
+- 2 copies of the third book
31
+- 1 copy of the fourth book
32
+- 1 copy of the fifth book
33
+ 
34
+One way of grouping these 8 books is:
35
+
36
+- 1 group of 5 --> 25% discount (1st,2nd,3rd,4th,5th)
37
+- +1 group of 3 --> 10% discount (1st,2nd,3rd)
38
+
39
+This would give a total of:
40
+
41
+- 5 books at a 25% discount
42
+- +3 books at a 10% discount
43
+
44
+Resulting in:
45
+
46
+- 5 x (8 - 2.00) == 5 x 6.00 == $30.00
47
+- +3 x (8 - 0.80) == 3 x 7.20 == $21.60
48
+
49
+For a total of $51.60
50
+
51
+However, a different way to group these 8 books is:
52
+
53
+- 1 group of 4 books --> 20% discount  (1st,2nd,3rd,4th)
54
+- +1 group of 4 books --> 20% discount  (1st,2nd,3rd,5th)
55
+
56
+This would give a total of:
57
+
58
+- 4 books at a 20% discount
59
+- +4 books at a 20% discount
60
+
61
+Resulting in:
62
+
63
+- 4 x (8 - 1.60) == 4 x 6.40 == $25.60
64
+- +4 x (8 - 1.60) == 4 x 6.40 == $25.60
65
+
66
+For a total of $51.20
67
+
68
+And $51.20 is the price with the biggest discount.
69
+
70
+
71
+To run the tests:
72
+
73
+```sh
74
+$ gradle test
75
+```
76
+
77
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
78
+
79
+
80
+## Source
81
+
82
+Inspired by the harry potter kata from Cyber-Dojo. [http://cyber-dojo.org](http://cyber-dojo.org)
83
+
84
+## Submitting Incomplete Solutions
85
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
86
+

+ 17
- 0
exercises/bowling/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,65 @@
1
+# Bowling
2
+
3
+Score a bowling game.
4
+
5
+Bowling is game where players roll a heavy ball to knock down pins
6
+arranged in a triangle. Write code to keep track of the score
7
+of a game of bowling.
8
+
9
+## Scoring Bowling
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.
12
+
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.
14
+
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.
16
+
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.
18
+
19
+Here is a three frame example:
20
+
21
+| Frame 1         | Frame 2       | Frame 3                |
22
+| :-------------: |:-------------:| :---------------------:|
23
+| X (strike)      | 5/ (spare)    | 9 0 (open frame)       |
24
+
25
+Frame 1 is (10 + 5 + 5) = 20
26
+
27
+Frame 2 is (5 + 5 + 9) = 19
28
+
29
+Frame 3 is (9 + 0) = 9
30
+
31
+This means the current running total is 48.
32
+
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.
34
+
35
+For a tenth frame of X1/ (strike and a spare), the total value is 20.
36
+
37
+For a tenth frame of XXX (three strikes), the total value is 30.
38
+
39
+## Requirements
40
+
41
+Write code to keep track of the score of a game of bowling. It should
42
+support two operations:
43
+
44
+* `roll(pins : int)` is called each time the player rolls a ball.  The
45
+  argument is the number of pins knocked down.
46
+* `score() : int` is called only at the very end of the game.  It
47
+  returns the total score for that game.
48
+
49
+
50
+To run the tests:
51
+
52
+```sh
53
+$ gradle test
54
+```
55
+
56
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
57
+
58
+
59
+## Source
60
+
61
+The Bowling Game Kata at but UncleBob [http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata)
62
+
63
+## Submitting Incomplete Solutions
64
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
65
+

+ 17
- 0
exercises/bracket-push/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,22 @@
1
+# Bracket Push
2
+
3
+Given a string containing brackets `[]`, braces `{}` and parentheses `()`,
4
+verify that all the pairs are matched and nested correctly.
5
+
6
+
7
+To run the tests:
8
+
9
+```sh
10
+$ gradle test
11
+```
12
+
13
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
14
+
15
+
16
+## Source
17
+
18
+Ginna Baker
19
+
20
+## Submitting Incomplete Solutions
21
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
22
+

+ 17
- 0
exercises/change/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,35 @@
1
+# Change
2
+
3
+Correctly determine the fewest number of coins to be given to a customer such
4
+that the sum of the coins' value would equal the correct amount of change.
5
+
6
+## For example
7
+
8
+- An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5)
9
+  and one dime (10) or [0, 1, 1, 0, 0]
10
+- An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5)
11
+  and one dime (10) and one quarter (25) or [0, 1, 1, 1, 0]
12
+
13
+## Edge cases
14
+
15
+- Does your algorithm work for any given set of coins?
16
+- Can you ask for negative change?
17
+- Can you ask for a change value smaller than the smallest coin value?
18
+
19
+
20
+To run the tests:
21
+
22
+```sh
23
+$ gradle test
24
+```
25
+
26
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
27
+
28
+
29
+## Source
30
+
31
+Software Craftsmanship - Kata-logue [http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata](http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata)
32
+
33
+## Submitting Incomplete Solutions
34
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
35
+

+ 17
- 0
exercises/circular-buffer/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,62 @@
1
+# Circular Buffer
2
+
3
+A circular buffer, cyclic buffer or ring buffer is a data structure that
4
+uses a single, fixed-size buffer as if it were connected end-to-end.
5
+
6
+A circular buffer first starts empty and of some predefined length. For
7
+example, this is a 7-element buffer:
8
+
9
+    [ ][ ][ ][ ][ ][ ][ ]
10
+
11
+Assume that a 1 is written into the middle of the buffer (exact starting
12
+location does not matter in a circular buffer):
13
+
14
+    [ ][ ][ ][1][ ][ ][ ]
15
+
16
+Then assume that two more elements are added — 2 & 3 — which get
17
+appended after the 1:
18
+
19
+    [ ][ ][ ][1][2][3][ ]
20
+
21
+If two elements are then removed from the buffer, the oldest values
22
+inside the buffer are removed. The two elements removed, in this case,
23
+are 1 & 2, leaving the buffer with just a 3:
24
+
25
+    [ ][ ][ ][ ][ ][3][ ]
26
+
27
+If the buffer has 7 elements then it is completely full:
28
+
29
+    [6][7][8][9][3][4][5]
30
+
31
+When the buffer is full an error will be raised, alerting the client
32
+that further writes are blocked until a slot becomes free.
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:
37
+
38
+    [6][7][8][9][A][B][5]
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:
43
+
44
+    [ ][7][8][9][A][B][ ]
45
+
46
+
47
+To run the tests:
48
+
49
+```sh
50
+$ gradle test
51
+```
52
+
53
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
54
+
55
+
56
+## Source
57
+
58
+Wikipedia [http://en.wikipedia.org/wiki/Circular_buffer](http://en.wikipedia.org/wiki/Circular_buffer)
59
+
60
+## Submitting Incomplete Solutions
61
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
62
+

+ 17
- 0
exercises/clock/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,30 @@
1
+# Clock
2
+
3
+Implement a clock that handles times without dates.
4
+
5
+You should be able to add and subtract minutes to it.
6
+
7
+Two clocks that represent the same time should be equal to each other.
8
+
9
+In order to satisfy the requirement that two clocks are considered equal just when they are set to the same time, you will need to override the [`equals`](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)) and [`hashcode`](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode) methods in your `Clock` class.
10
+ 
11
+For more information on how to override these methods, see [this JavaWorld article](https://web.archive.org/web/20170528222153/http://www.javaworld.com/article/2072762/java-app-dev/object-equality.html).
12
+
13
+
14
+
15
+To run the tests:
16
+
17
+```sh
18
+$ gradle test
19
+```
20
+
21
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
22
+
23
+
24
+## Source
25
+
26
+Pairing session with Erin Drummond [https://twitter.com/ebdrummond](https://twitter.com/ebdrummond)
27
+
28
+## Submitting Incomplete Solutions
29
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
30
+

+ 17
- 0
exercises/collatz-conjecture/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,45 @@
1
+# Collatz Conjecture
2
+
3
+The Collatz Conjecture or 3x+1 problem can be summarized as follows:
4
+
5
+Take any positive integer n. If n is even, divide n by 2 to get n / 2. If n is
6
+odd, multiply n by 3 and add 1 to get 3n + 1. Repeat the process indefinitely.
7
+The conjecture states that no matter which number you start with, you will
8
+always reach 1 eventually.
9
+
10
+Given a number n, return the number of steps required to reach 1.
11
+
12
+## Examples
13
+Starting with n = 12, the steps would be as follows:
14
+
15
+0. 12
16
+1. 6
17
+2. 3
18
+3. 10
19
+4. 5
20
+5. 16
21
+6. 8
22
+7. 4
23
+8. 2
24
+9. 1
25
+
26
+Resulting in 9 steps. So for input n = 12, the return value would be 9.
27
+
28
+
29
+
30
+To run the tests:
31
+
32
+```sh
33
+$ gradle test
34
+```
35
+
36
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
37
+
38
+
39
+## Source
40
+
41
+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)
42
+
43
+## Submitting Incomplete Solutions
44
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
45
+

+ 17
- 0
exercises/complex-numbers/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,23 @@
1
+# Complex Numbers
2
+
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
+
5
+Assume the programming language you are using does not have an implementation of complex numbers.
6
+
7
+
8
+To run the tests:
9
+
10
+```sh
11
+$ gradle test
12
+```
13
+
14
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
15
+
16
+
17
+## Source
18
+
19
+Wikipedia [https://en.wikipedia.org/wiki/Complex_number](https://en.wikipedia.org/wiki/Complex_number)
20
+
21
+## Submitting Incomplete Solutions
22
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
23
+

+ 17
- 0
exercises/crypto-square/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,86 @@
1
+# Crypto Square
2
+
3
+Implement the classic method for composing secret messages called a square code.
4
+
5
+Given an English text, output the encoded version of that text.
6
+
7
+First, the input is normalized: the spaces and punctuation are removed
8
+from the English text and the message is downcased.
9
+
10
+Then, the normalized characters are broken into rows.  These rows can be
11
+regarded as forming a rectangle when printed with intervening newlines.
12
+
13
+For example, the sentence
14
+
15
+> If man was meant to stay on the ground, god would have given us roots.
16
+
17
+is normalized to:
18
+
19
+> ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots
20
+
21
+The plaintext should be organized in to a rectangle.  The size of the
22
+rectangle (`r x c`) should be decided by the length of the message,
23
+such that `c >= r` and `c - r <= 1`, where `c` is the number of columns
24
+and `r` is the number of rows.
25
+
26
+Our normalized text is 54 characters long, dictating a rectangle with
27
+`c = 8` and `r = 7`:
28
+
29
+```plain
30
+ifmanwas
31
+meanttos
32
+tayonthe
33
+groundgo
34
+dwouldha
35
+vegivenu
36
+sroots
37
+```
38
+
39
+The coded message is obtained by reading down the columns going left to
40
+right.
41
+
42
+The message above is coded as:
43
+
44
+```plain
45
+imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
46
+```
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.
51
+
52
+```plain
53
+imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
54
+```
55
+
56
+Notice that were we to stack these, we could visually decode the
57
+cyphertext back in to the original message:
58
+
59
+```plain
60
+imtgdvs
61
+fearwer
62
+mayoogo
63
+anouuio
64
+ntnnlvt
65
+wttddes
66
+aohghn
67
+sseoau
68
+```
69
+
70
+
71
+To run the tests:
72
+
73
+```sh
74
+$ gradle test
75
+```
76
+
77
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
78
+
79
+
80
+## Source
81
+
82
+J Dalbey's Programming Practice problems [http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html](http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html)
83
+
84
+## Submitting Incomplete Solutions
85
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
86
+

+ 17
- 0
exercises/custom-set/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,23 @@
1
+# Custom Set
2
+
3
+Create a custom set type.
4
+
5
+Sometimes it is necessary to define a custom data structure of some
6
+type, like a set. In this exercise you will define your own set. How it
7
+works internally doesn't matter, as long as it behaves like a set of
8
+unique elements.
9
+
10
+
11
+To run the tests:
12
+
13
+```sh
14
+$ gradle test
15
+```
16
+
17
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
18
+
19
+
20
+
21
+## Submitting Incomplete Solutions
22
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
23
+

+ 17
- 0
exercises/diamond/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,71 @@
1
+# Diamond
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 
5
+supplied letter at the widest point.
6
+
7
+## Requirements
8
+
9
+* The first row contains one 'A'.
10
+* The last row contains one 'A'.
11
+* All rows, except the first and last, have exactly two identical letters.
12
+* All rows have as many trailing spaces as leading spaces. (This might be 0).
13
+* The diamond is horizontally symmetric.
14
+* The diamond is vertically symmetric.
15
+* The diamond has a square shape (width equals height).
16
+* The letters form a diamond shape.
17
+* The top half has the letters in ascending order.
18
+* The bottom half has the letters in descending order. 
19
+* The four corners (containing the spaces) are triangles.
20
+
21
+## Examples
22
+
23
+In the following examples, spaces are indicated by `·` characters.
24
+
25
+Diamond for letter 'A':
26
+
27
+```plain
28
+A
29
+```
30
+
31
+Diamond for letter 'C':
32
+
33
+```plain
34
+··A··
35
+·B·B·
36
+C···C
37
+·B·B·
38
+··A··
39
+```
40
+
41
+Diamond for letter 'E':
42
+
43
+```plain
44
+····A····
45
+···B·B···
46
+··C···C··
47
+·D·····D·
48
+E·······E
49
+·D·····D·
50
+··C···C··
51
+···B·B···
52
+····A····
53
+```
54
+
55
+
56
+To run the tests:
57
+
58
+```sh
59
+$ gradle test
60
+```
61
+
62
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
63
+
64
+
65
+## Source
66
+
67
+Seb Rose [http://claysnow.co.uk/recycling-tests-in-tdd/](http://claysnow.co.uk/recycling-tests-in-tdd/)
68
+
69
+## Submitting Incomplete Solutions
70
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
71
+

+ 17
- 0
exercises/difference-of-squares/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

+ 31
- 0
exercises/difference-of-squares/README.md Просмотреть файл

@@ -0,0 +1,31 @@
1
+# Difference Of Squares
2
+
3
+Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.
4
+
5
+The square of the sum of the first ten natural numbers is
6
+(1 + 2 + ... + 10)² = 55² = 3025.
7
+
8
+The sum of the squares of the first ten natural numbers is
9
+1² + 2² + ... + 10² = 385.
10
+
11
+Hence the difference between the square of the sum of the first
12
+ten natural numbers and the sum of the squares of the first ten
13
+natural numbers is 3025 - 385 = 2640.
14
+
15
+
16
+To run the tests:
17
+
18
+```sh
19
+$ gradle test
20
+```
21
+
22
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
23
+
24
+
25
+## Source
26
+
27
+Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6)
28
+
29
+## Submitting Incomplete Solutions
30
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
31
+

+ 17
- 0
exercises/etl/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,63 @@
1
+# Etl
2
+
3
+We are going to do the `Transform` step of an Extract-Transform-Load.
4
+
5
+### ETL
6
+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
+we're going to migrate this."
8
+
9
+(Typically, this is followed by, "We're only going to need to run this
10
+once." That's then typically followed by much forehead slapping and
11
+moaning about how stupid we could possibly be.)
12
+
13
+### The goal
14
+We're going to extract some scrabble scores from a legacy system.
15
+
16
+The old system stored a list of letters per score:
17
+
18
+- 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T",
19
+- 2 points: "D", "G",
20
+- 3 points: "B", "C", "M", "P",
21
+- 4 points: "F", "H", "V", "W", "Y",
22
+- 5 points: "K",
23
+- 8 points: "J", "X",
24
+- 10 points: "Q", "Z",
25
+
26
+The shiny new scrabble system instead stores the score per letter, which
27
+makes it much faster and easier to calculate the score for a word. It
28
+also stores the letters in lower-case regardless of the case of the
29
+input letters:
30
+
31
+- "a" is worth 1 point.
32
+- "b" is worth 3 points.
33
+- "c" is worth 3 points.
34
+- "d" is worth 2 points.
35
+- Etc.
36
+
37
+Your mission, should you choose to accept it, is to transform the legacy data
38
+format to the shiny new format.
39
+
40
+### Notes
41
+
42
+A final note about scoring, Scrabble is played around the world in a
43
+variety of languages, each with its own unique scoring table. For
44
+example, an "E" is scored at 2 in the Māori-language version of the
45
+game while being scored at 4 in the Hawaiian-language version.
46
+
47
+
48
+To run the tests:
49
+
50
+```sh
51
+$ gradle test
52
+```
53
+
54
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
55
+
56
+
57
+## Source
58
+
59
+The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com)
60
+
61
+## Submitting Incomplete Solutions
62
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
63
+

+ 17
- 0
exercises/flatten-array/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,30 @@
1
+# Flatten Array
2
+
3
+Take a nested list and return a single flattened list with all values except nil/null.
4
+
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
+ 
7
+For Example
8
+
9
+input: [1,[2,3,null,4],[null],5]
10
+
11
+output: [1,2,3,4,5]
12
+
13
+
14
+
15
+To run the tests:
16
+
17
+```sh
18
+$ gradle test
19
+```
20
+
21
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
22
+
23
+
24
+## Source
25
+
26
+Interview Question [https://reference.wolfram.com/language/ref/Flatten.html](https://reference.wolfram.com/language/ref/Flatten.html)
27
+
28
+## Submitting Incomplete Solutions
29
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
30
+

+ 17
- 0
exercises/food-chain/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,82 @@
1
+# Food Chain
2
+
3
+Generate the lyrics of the song 'I Know an Old Lady Who Swallowed a Fly'.
4
+
5
+While you could copy/paste the lyrics,
6
+or read them from a file, this problem is much more
7
+interesting if you approach it algorithmically.
8
+
9
+This is a [cumulative song](http://en.wikipedia.org/wiki/Cumulative_song) of unknown origin.
10
+
11
+This is one of many common variants.
12
+
13
+```plain
14
+I know an old lady who swallowed a fly.
15
+I don't know why she swallowed the fly. Perhaps she'll die.
16
+
17
+I know an old lady who swallowed a spider.
18
+It wriggled and jiggled and tickled inside her.
19
+She swallowed the spider to catch the fly.
20
+I don't know why she swallowed the fly. Perhaps she'll die.
21
+
22
+I know an old lady who swallowed a bird.
23
+How absurd to swallow a bird!
24
+She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
25
+She swallowed the spider to catch the fly.
26
+I don't know why she swallowed the fly. Perhaps she'll die.
27
+
28
+I know an old lady who swallowed a cat.
29
+Imagine that, to swallow a cat!
30
+She swallowed the cat to catch the bird.
31
+She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
32
+She swallowed the spider to catch the fly.
33
+I don't know why she swallowed the fly. Perhaps she'll die.
34
+
35
+I know an old lady who swallowed a dog.
36
+What a hog, to swallow a dog!
37
+She swallowed the dog to catch the cat.
38
+She swallowed the cat to catch the bird.
39
+She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
40
+She swallowed the spider to catch the fly.
41
+I don't know why she swallowed the fly. Perhaps she'll die.
42
+
43
+I know an old lady who swallowed a goat.
44
+Just opened her throat and swallowed a goat!
45
+She swallowed the goat to catch the dog.
46
+She swallowed the dog to catch the cat.
47
+She swallowed the cat to catch the bird.
48
+She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
49
+She swallowed the spider to catch the fly.
50
+I don't know why she swallowed the fly. Perhaps she'll die.
51
+
52
+I know an old lady who swallowed a cow.
53
+I don't know how she swallowed a cow!
54
+She swallowed the cow to catch the goat.
55
+She swallowed the goat to catch the dog.
56
+She swallowed the dog to catch the cat.
57
+She swallowed the cat to catch the bird.
58
+She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
59
+She swallowed the spider to catch the fly.
60
+I don't know why she swallowed the fly. Perhaps she'll die.
61
+
62
+I know an old lady who swallowed a horse.
63
+She's dead, of course!
64
+```
65
+
66
+
67
+To run the tests:
68
+
69
+```sh
70
+$ gradle test
71
+```
72
+
73
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
74
+
75
+
76
+## Source
77
+
78
+Wikipedia [http://en.wikipedia.org/wiki/There_Was_an_Old_Lady_Who_Swallowed_a_Fly](http://en.wikipedia.org/wiki/There_Was_an_Old_Lady_Who_Swallowed_a_Fly)
79
+
80
+## Submitting Incomplete Solutions
81
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
82
+

+ 17
- 0
exercises/gigasecond/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,23 @@
1
+# Gigasecond
2
+
3
+Calculate the moment when someone has lived for 10^9 seconds.
4
+
5
+A gigasecond is 10^9 (1,000,000,000) seconds.
6
+
7
+
8
+To run the tests:
9
+
10
+```sh
11
+$ gradle test
12
+```
13
+
14
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
15
+
16
+
17
+## Source
18
+
19
+Chapter 9 in Chris Pine's online Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=09](http://pine.fm/LearnToProgram/?Chapter=09)
20
+
21
+## Submitting Incomplete Solutions
22
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
23
+

+ 17
- 0
exercises/grade-school/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,54 @@
1
+# Grade School
2
+
3
+Given students' names along with the grade that they are in, create a roster
4
+for the school.
5
+
6
+In the end, you should be able to:
7
+
8
+- Add a student's name to the roster for a grade
9
+  - "Add Jim to grade 2."
10
+  - "OK."
11
+- Get a list of all students enrolled in a grade
12
+  - "Which students are in grade 2?"
13
+  - "We've only got Jim just now."
14
+- Get a sorted list of all students in all grades.  Grades should sort
15
+  as 1, 2, 3, etc., and students within a grade should be sorted
16
+  alphabetically by name.
17
+  - "Who all is enrolled in school right now?"
18
+  - "Grade 1: Anna, Barb, and Charlie. Grade 2: Alex, Peter, and Zoe.
19
+    Grade 3…"
20
+
21
+Note that all our students only have one name.  (It's a small town, what
22
+do you want?)
23
+
24
+
25
+## For bonus points
26
+
27
+Did you get the tests passing and the code clean? If you want to, these
28
+are some additional things you could try:
29
+
30
+- If you're working in a language with mutable data structures and your
31
+  implementation allows outside code to mutate the school's internal DB
32
+  directly, see if you can prevent this. Feel free to introduce additional
33
+  tests.
34
+
35
+Then please share your thoughts in a comment on the submission. Did this
36
+experiment make the code better? Worse? Did you learn anything from it?
37
+
38
+
39
+To run the tests:
40
+
41
+```sh
42
+$ gradle test
43
+```
44
+
45
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
46
+
47
+
48
+## Source
49
+
50
+A pairing session with Phil Battos at gSchool [http://gschool.it](http://gschool.it)
51
+
52
+## Submitting Incomplete Solutions
53
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
54
+

+ 17
- 0
exercises/hamming/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,68 @@
1
+# Hamming
2
+
3
+Calculate the Hamming difference between two DNA strands.
4
+
5
+A mutation is simply a mistake that occurs during the creation or
6
+copying of a nucleic acid, in particular DNA. Because nucleic acids are
7
+vital to cellular functions, mutations tend to cause a ripple effect
8
+throughout the cell. Although mutations are technically mistakes, a very
9
+rare mutation may equip the cell with a beneficial attribute. In fact,
10
+the macro effects of evolution are attributable by the accumulated
11
+result of beneficial microscopic mutations over many generations.
12
+
13
+The simplest and most common type of nucleic acid mutation is a point
14
+mutation, which replaces one base with another at a single nucleotide.
15
+
16
+By counting the number of differences between two homologous DNA strands
17
+taken from different genomes with a common ancestor, we get a measure of
18
+the minimum number of point mutations that could have occurred on the
19
+evolutionary path between the two strands.
20
+
21
+This is called the 'Hamming distance'.
22
+
23
+It is found by comparing two DNA strands and counting how many of the
24
+nucleotides are different from their equivalent in the other string.
25
+
26
+    GAGCCTACTAACGGGAT
27
+    CATCGTAATGACGGCCT
28
+    ^ ^ ^  ^ ^    ^^
29
+
30
+The Hamming distance between these two DNA strands is 7.
31
+
32
+# Implementation notes
33
+
34
+The Hamming distance is only defined for sequences of equal length. This means
35
+that based on the definition, each language could deal with getting sequences
36
+of equal length differently.
37
+
38
+## Hints
39
+
40
+This is the first exercise with tests that require you to throw an
41
+[`Exception`](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html). `Exception`s are typically thrown to
42
+indicate that a program has encountered an unexpected input or state.
43
+
44
+We use JUnit's [`ExpectedException`](http://junit.org/junit4/javadoc/4.12/org/junit/rules/ExpectedException.html)
45
+[rule](https://github.com/junit-team/junit4/wiki/rules) throughout the track to verify that the exceptions you throw
46
+are:
47
+
48
+1. instances of a specified Java type;
49
+2. (optionally) initialized with a specified message.
50
+
51
+
52
+
53
+To run the tests:
54
+
55
+```sh
56
+$ gradle test
57
+```
58
+
59
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
60
+
61
+
62
+## Source
63
+
64
+The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/)
65
+
66
+## Submitting Incomplete Solutions
67
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
68
+

+ 17
- 0
exercises/hello-world/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,39 @@
1
+# Hello World
2
+
3
+The classical introductory exercise. Just say "Hello, World!".
4
+
5
+["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
6
+the traditional first program for beginning programming in a new language
7
+or environment.
8
+
9
+The objectives are simple:
10
+
11
+- Write a function that returns the string "Hello, World!".
12
+- Run the test suite and make sure that it succeeds.
13
+- Submit your solution and check it at the website.
14
+
15
+If everything goes well, you will be ready to fetch your first real exercise.
16
+
17
+Since this is your first Java exercise, we've included a detailed TUTORIAL.md
18
+file that guides you through your solution. Check it out for tips and
19
+assistance!
20
+
21
+
22
+
23
+
24
+To run the tests:
25
+
26
+```sh
27
+$ gradle test
28
+```
29
+
30
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
31
+
32
+
33
+## Source
34
+
35
+This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program)
36
+
37
+## Submitting Incomplete Solutions
38
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
39
+

+ 17
- 0
exercises/hexadecimal/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,26 @@
1
+# Hexadecimal
2
+
3
+Convert a hexadecimal number, represented as a string (e.g. "10af8c"), to its decimal equivalent using first principles (i.e. no, you may not use built-in or external libraries to accomplish the conversion).
4
+
5
+On the web we use hexadecimal to represent colors, e.g. green: 008000,
6
+teal: 008080, navy: 000080).
7
+
8
+The program should handle invalid hexadecimal strings.
9
+
10
+
11
+To run the tests:
12
+
13
+```sh
14
+$ gradle test
15
+```
16
+
17
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
18
+
19
+
20
+## Source
21
+
22
+All of Computer Science [http://www.wolframalpha.com/examples/NumberBases.html](http://www.wolframalpha.com/examples/NumberBases.html)
23
+
24
+## Submitting Incomplete Solutions
25
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
26
+

+ 17
- 0
exercises/isogram/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,42 @@
1
+# Isogram
2
+
3
+Determine if a word or phrase is an isogram.
4
+
5
+An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
6
+
7
+Examples of isograms:
8
+
9
+- lumberjacks
10
+- background
11
+- downstream
12
+
13
+The word *isograms*, however, is not an isogram, because the s repeats.
14
+
15
+If you find that `testWorksWithGermanLetters` fails even though you think you've implemented it correctly,
16
+this could be because of the [JVM encoding](https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_61/rzaha/international.htm). 
17
+Try setting the `JAVA_TOOL_OPTIONS` environment variable to `-Dfile.encoding=UTF8` to fix this.
18
+- To set an environment variable on Windows:
19
+    1. Go to Computer -> Properties -> Advanced System Settings
20
+    2. Add a new environment variable
21
+
22
+- [To set an environment variable on a mac](http://blog.lidalia.org.uk/2011/04/setting-default-java-file-encoding-to.html)
23
+
24
+- [To set an environment variable on linux](https://unix.stackexchange.com/questions/151733/where-can-i-set-global-java-options)
25
+
26
+
27
+To run the tests:
28
+
29
+```sh
30
+$ gradle test
31
+```
32
+
33
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
34
+
35
+
36
+## Source
37
+
38
+Wikipedia [https://en.wikipedia.org/wiki/Isogram](https://en.wikipedia.org/wiki/Isogram)
39
+
40
+## Submitting Incomplete Solutions
41
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
42
+

+ 17
- 0
exercises/kindergarten-garden/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,78 @@
1
+# Kindergarten Garden
2
+
3
+Given a diagram, determine which plants each child in the kindergarten class is
4
+responsible for.
5
+
6
+The kindergarten class is learning about growing plants. The teachers
7
+thought it would be a good idea to give them actual seeds, plant them in
8
+actual dirt, and grow actual plants.
9
+
10
+They've chosen to grow grass, clover, radishes, and violets.
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.
15
+
16
+```plain
17
+[window][window][window]
18
+........................ # each dot represents a styrofoam cup
19
+........................
20
+```
21
+
22
+There are 12 children in the class:
23
+
24
+- Alice, Bob, Charlie, David,
25
+- Eve, Fred, Ginny, Harriet,
26
+- Ileana, Joseph, Kincaid, and Larry.
27
+
28
+Each child gets 4 cups, two on each row. The children are assigned to
29
+cups in alphabetical order.
30
+
31
+The following diagram represents Alice's plants:
32
+
33
+```plain
34
+[window][window][window]
35
+VR......................
36
+RG......................
37
+```
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.
41
+
42
+Your program will be given the plants from left-to-right starting with
43
+the row nearest the windows. From this, it should be able to determine
44
+which plants belong to which students.
45
+
46
+For example, if it's told that the garden looks like so:
47
+
48
+```plain
49
+[window][window][window]
50
+VRCGVVRVCGGCCGVRGCVCGCGV
51
+VRCCCGCRRGVCGCRVVCVGCGCV
52
+```
53
+
54
+Then if asked for Alice's plants, it should provide:
55
+
56
+- Violets, radishes, violets, radishes
57
+
58
+While asking for Bob's plants would yield:
59
+
60
+- Clover, grass, clover, clover
61
+
62
+
63
+To run the tests:
64
+
65
+```sh
66
+$ gradle test
67
+```
68
+
69
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
70
+
71
+
72
+## Source
73
+
74
+Random musings during airplane trip. [http://jumpstartlab.com](http://jumpstartlab.com)
75
+
76
+## Submitting Incomplete Solutions
77
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
78
+

+ 17
- 0
exercises/largest-series-product/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

+ 32
- 0
exercises/largest-series-product/README.md Просмотреть файл

@@ -0,0 +1,32 @@
1
+# Largest Series Product
2
+
3
+Given a string of digits, calculate the largest product for a contiguous
4
+substring of digits of length n.
5
+
6
+For example, for the input `'1027839564'`, the largest product for a
7
+series of 3 digits is 270 (9 * 5 * 6), and the largest product for a
8
+series of 5 digits is 7560 (7 * 8 * 3 * 9 * 5).
9
+
10
+Note that these series are only required to occupy *adjacent positions*
11
+in the input; the digits need not be *numerically consecutive*.
12
+
13
+For the input `'73167176531330624919225119674426574742355349194934'`,
14
+the largest product for a series of 6 digits is 23520.
15
+
16
+
17
+To run the tests:
18
+
19
+```sh
20
+$ gradle test
21
+```
22
+
23
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
24
+
25
+
26
+## Source
27
+
28
+A variation on Problem 8 at Project Euler [http://projecteuler.net/problem=8](http://projecteuler.net/problem=8)
29
+
30
+## Submitting Incomplete Solutions
31
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
32
+

+ 17
- 0
exercises/linked-list/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,46 @@
1
+# Linked List
2
+
3
+Implement a doubly linked list.
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, 
7
+stacks, and associative arrays.
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 
12
+node.
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 
17
+offers an array-like interface for adding and removing items:
18
+
19
+* `push` (*insert value at back*);
20
+* `pop` (*remove value at back*);
21
+* `shift` (*remove value at front*).
22
+* `unshift` (*insert value at front*);
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 
26
+empty list.
27
+
28
+If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list).
29
+
30
+
31
+To run the tests:
32
+
33
+```sh
34
+$ gradle test
35
+```
36
+
37
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
38
+
39
+
40
+## Source
41
+
42
+Classic computer science topic
43
+
44
+## Submitting Incomplete Solutions
45
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
46
+

+ 17
- 0
exercises/list-ops/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,27 @@
1
+# List Ops
2
+
3
+Implement basic list operations.
4
+
5
+In functional languages list operations like `length`, `map`, and
6
+`reduce` are very common. Implement a series of basic list operations,
7
+without using existing functions.
8
+
9
+## Hints
10
+
11
+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
+
13
+
14
+
15
+To run the tests:
16
+
17
+```sh
18
+$ gradle test
19
+```
20
+
21
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
22
+
23
+
24
+
25
+## Submitting Incomplete Solutions
26
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
27
+

+ 17
- 0
exercises/luhn/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,83 @@
1
+# Luhn
2
+
3
+Given a number determine whether or not it is valid per the Luhn formula.
4
+
5
+The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is
6
+a simple checksum formula used to validate a variety of identification
7
+numbers, such as credit card numbers and Canadian Social Insurance
8
+Numbers.
9
+
10
+The task is to check if a given string is valid.
11
+
12
+Validating a Number
13
+------
14
+
15
+Strings of length 1 or less are not valid. Spaces are allowed in the input,
16
+but they should be stripped before checking. All other non-digit characters
17
+are disallowed.
18
+
19
+## Example 1: valid credit card number
20
+
21
+```
22
+4539 1488 0343 6467
23
+```
24
+
25
+The first step of the Luhn algorithm is to double every second digit,
26
+starting from the right. We will be doubling
27
+
28
+```
29
+4_3_ 1_8_ 0_4_ 6_6_
30
+```
31
+
32
+If doubling the number results in a number greater than 9 then subtract 9
33
+from the product. The results of our doubling:
34
+
35
+```
36
+8569 2478 0383 3437
37
+```
38
+
39
+Then sum all of the digits:
40
+
41
+```
42
+8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
43
+```
44
+
45
+If the sum is evenly divisible by 10, then the number is valid. This number is valid!
46
+
47
+## Example 2: invalid credit card number
48
+
49
+```
50
+8273 1232 7352 0569
51
+```
52
+
53
+Double the second digits, starting from the right
54
+
55
+```
56
+7253 2262 5312 0539
57
+```
58
+
59
+Sum the digits
60
+
61
+```
62
+7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
63
+```
64
+
65
+57 is not evenly divisible by 10, so this number is not valid.
66
+
67
+
68
+To run the tests:
69
+
70
+```sh
71
+$ gradle test
72
+```
73
+
74
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
75
+
76
+
77
+## Source
78
+
79
+The Luhn Algorithm on Wikipedia [http://en.wikipedia.org/wiki/Luhn_algorithm](http://en.wikipedia.org/wiki/Luhn_algorithm)
80
+
81
+## Submitting Incomplete Solutions
82
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
83
+

+ 17
- 0
exercises/matrix/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,57 @@
1
+# Matrix
2
+
3
+Given a string representing a matrix of numbers, return the rows and columns of
4
+that matrix.
5
+
6
+So given a string with embedded newlines like:
7
+
8
+> 9 8 7  
9
+> 5 3 2  
10
+> 6 6 7  
11
+
12
+representing this matrix:
13
+
14
+```plain
15
+    0  1  2
16
+  |---------
17
+0 | 9  8  7
18
+1 | 5  3  2
19
+2 | 6  6  7
20
+```
21
+
22
+your code should be able to spit out:
23
+
24
+- A list of the rows, reading each row left-to-right while moving
25
+  top-to-bottom across the rows,
26
+- A list of the columns, reading each column top-to-bottom while moving
27
+  from left-to-right.
28
+
29
+The rows for our example matrix:
30
+
31
+- 9, 8, 7
32
+- 5, 3, 2
33
+- 6, 6, 7
34
+
35
+And its columns:
36
+
37
+- 9, 5, 6
38
+- 8, 3, 6
39
+- 7, 2, 7
40
+
41
+
42
+To run the tests:
43
+
44
+```sh
45
+$ gradle test
46
+```
47
+
48
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
49
+
50
+
51
+## Source
52
+
53
+Warmup to the `saddle-points` warmup. [http://jumpstartlab.com](http://jumpstartlab.com)
54
+
55
+## Submitting Incomplete Solutions
56
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
57
+

+ 17
- 0
exercises/meetup/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,42 @@
1
+# Meetup
2
+
3
+Calculate the date of meetups.
4
+
5
+Typically meetups happen on the same day of the week.  In this exercise, you will take
6
+a description of a meetup date, and return the actual meetup date.
7
+
8
+Examples of general descriptions are:
9
+
10
+- the first Monday of January 2017
11
+- the third Tuesday of January 2017
12
+- the Wednesteenth of January 2017
13
+- the last Thursday of January 2017
14
+
15
+Note that "Monteenth", "Tuesteenth", etc are all made up words. There
16
+was a meetup whose members realized that there are exactly 7 numbered days in a month that
17
+end in '-teenth'. Therefore, one is guaranteed that each day of the week
18
+(Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
19
+in every month.
20
+
21
+Given examples of a meetup dates, each containing a month, day, year, and descriptor 
22
+(first, second, teenth, etc), calculate the date of the actual meetup.
23
+For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
24
+ 
25
+
26
+
27
+To run the tests:
28
+
29
+```sh
30
+$ gradle test
31
+```
32
+
33
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
34
+
35
+
36
+## Source
37
+
38
+Jeremy Hinegardner mentioned a Boulder meetup that happens on the Wednesteenth of every month [https://twitter.com/copiousfreetime](https://twitter.com/copiousfreetime)
39
+
40
+## Submitting Incomplete Solutions
41
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
42
+

+ 17
- 0
exercises/minesweeper/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,42 @@
1
+# Minesweeper
2
+
3
+Add the numbers to a minesweeper board.
4
+
5
+Minesweeper is a popular game where the user has to find the mines using
6
+numeric hints that indicate how many mines are directly adjacent
7
+(horizontally, vertically, diagonally) to a square.
8
+
9
+In this exercise you have to create some code that counts the number of
10
+mines adjacent to a square and transforms boards like this (where `*`
11
+indicates a mine):
12
+
13
+    +-----+
14
+    | * * |
15
+    |  *  |
16
+    |  *  |
17
+    |     |
18
+    +-----+
19
+
20
+into this:
21
+
22
+    +-----+
23
+    |1*3*1|
24
+    |13*31|
25
+    | 2*2 |
26
+    | 111 |
27
+    +-----+
28
+
29
+
30
+To run the tests:
31
+
32
+```sh
33
+$ gradle test
34
+```
35
+
36
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
37
+
38
+
39
+
40
+## Submitting Incomplete Solutions
41
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
42
+

+ 17
- 0
exercises/nth-prime/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,27 @@
1
+# Nth Prime
2
+
3
+Given a number n, determine what the nth prime is.
4
+
5
+By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that
6
+the 6th prime is 13.
7
+
8
+If your language provides methods in the standard library to deal with prime
9
+numbers, pretend they don't exist and implement them yourself.
10
+
11
+
12
+To run the tests:
13
+
14
+```sh
15
+$ gradle test
16
+```
17
+
18
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
19
+
20
+
21
+## Source
22
+
23
+A variation on Problem 7 at Project Euler [http://projecteuler.net/problem=7](http://projecteuler.net/problem=7)
24
+
25
+## Submitting Incomplete Solutions
26
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
27
+

+ 17
- 0
exercises/nucleotide-count/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,45 @@
1
+# Nucleotide Count
2
+
3
+Given a DNA string, compute how many times each nucleotide occurs in the string.
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:
12
+
13
+- 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.
28
+
29
+
30
+To run the tests:
31
+
32
+```sh
33
+$ gradle test
34
+```
35
+
36
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
37
+
38
+
39
+## Source
40
+
41
+The Calculating DNA Nucleotides_problem at Rosalind [http://rosalind.info/problems/dna/](http://rosalind.info/problems/dna/)
42
+
43
+## Submitting Incomplete Solutions
44
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
45
+

+ 17
- 0
exercises/ocr-numbers/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,97 @@
1
+# Ocr Numbers
2
+
3
+Given a 3 x 4 grid of pipes, underscores, and spaces, determine which number is
4
+represented, or whether it is garbled.
5
+
6
+# Step One
7
+
8
+To begin with, convert a simple binary font to a string containing 0 or 1.
9
+
10
+The binary font uses pipes and underscores, four rows high and three columns wide.
11
+
12
+```
13
+     _   #
14
+    | |  # zero.
15
+    |_|  #
16
+         # the fourth row is always blank
17
+```
18
+
19
+Is converted to "0"
20
+
21
+```
22
+         #
23
+      |  # one.
24
+      |  #
25
+         # (blank fourth row)
26
+```
27
+
28
+Is converted to "1"
29
+
30
+If the input is the correct size, but not recognizable, your program should return '?'
31
+
32
+If the input is the incorrect size, your program should return an error.
33
+
34
+# Step Two
35
+
36
+Update your program to recognize multi-character binary strings, replacing garbled numbers with ?
37
+
38
+# Step Three
39
+
40
+Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.
41
+
42
+```
43
+ _ 
44
+ _|
45
+|_ 
46
+   
47
+```
48
+
49
+Is converted to "2"
50
+
51
+```
52
+      _  _     _  _  _  _  _  _  #
53
+    | _| _||_||_ |_   ||_||_|| | # decimal numbers.
54
+    ||_  _|  | _||_|  ||_| _||_| #
55
+                                 # fourth line is always blank
56
+```
57
+
58
+Is converted to "1234567890"
59
+
60
+# Step Four
61
+
62
+Update your program to handle multiple numbers, one per line. When converting several lines, join the lines with commas.
63
+
64
+```
65
+    _  _ 
66
+  | _| _|
67
+  ||_  _|
68
+         
69
+    _  _ 
70
+|_||_ |_ 
71
+  | _||_|
72
+         
73
+ _  _  _ 
74
+  ||_||_|
75
+  ||_| _|
76
+         
77
+```
78
+
79
+Is converted to "123,456,789"
80
+
81
+
82
+To run the tests:
83
+
84
+```sh
85
+$ gradle test
86
+```
87
+
88
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
89
+
90
+
91
+## Source
92
+
93
+Inspired by the Bank OCR kata [http://codingdojo.org/cgi-bin/wiki.pl?KataBankOCR](http://codingdojo.org/cgi-bin/wiki.pl?KataBankOCR)
94
+
95
+## Submitting Incomplete Solutions
96
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
97
+

+ 17
- 0
exercises/octal/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,61 @@
1
+# Octal
2
+
3
+Convert an octal number, represented as a string (e.g. '1735263'), to its
4
+decimal equivalent using first principles (i.e. no, you may not use built-in or
5
+external libraries to accomplish the conversion).
6
+
7
+Implement octal to decimal conversion.  Given an octal input
8
+string, your program should produce a decimal output.
9
+
10
+## Note
11
+- Implement the conversion yourself.
12
+  Do not use something else to perform the conversion for you.
13
+- Treat invalid input as octal 0.
14
+
15
+## About Octal (Base-8)
16
+Decimal is a base-10 system.
17
+
18
+A number 233 in base 10 notation can be understood
19
+as a linear combination of powers of 10:
20
+
21
+- The rightmost digit gets multiplied by 10^0 = 1
22
+- The next number gets multiplied by 10^1 = 10
23
+- ...
24
+- The *n*th number gets multiplied by 10^*(n-1)*.
25
+- All these values are summed.
26
+
27
+So:
28
+```
29
+   233 # decimal
30
+ = 2*10^2 + 3*10^1 + 3*10^0
31
+ = 2*100  + 3*10   + 3*1
32
+```
33
+
34
+Octal is similar, but uses powers of 8 rather than powers of 10.
35
+
36
+So:
37
+```
38
+   233 # octal
39
+ = 2*8^2 + 3*8^1 + 3*8^0
40
+ = 2*64  + 3*8   + 3*1
41
+ = 128   + 24    + 3
42
+ = 155
43
+```
44
+
45
+
46
+To run the tests:
47
+
48
+```sh
49
+$ gradle test
50
+```
51
+
52
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
53
+
54
+
55
+## Source
56
+
57
+All of Computer Science [http://www.wolframalpha.com/input/?i=base+8](http://www.wolframalpha.com/input/?i=base+8)
58
+
59
+## Submitting Incomplete Solutions
60
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
61
+

+ 17
- 0
exercises/palindrome-products/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,52 @@
1
+# Palindrome Products
2
+
3
+Detect palindrome products in a given range.
4
+
5
+A palindromic number is a number that remains the same when its digits are
6
+reversed. For example, `121` is a palindromic number but `112` is not.
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).
11
+
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.
21
+
22
+## Example 1
23
+
24
+Given the range `[1, 9]` (both inclusive)...
25
+
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)`.
28
+
29
+## Example 2
30
+
31
+Given the range `[10, 99]` (both inclusive)...
32
+
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)`.
35
+
36
+
37
+To run the tests:
38
+
39
+```sh
40
+$ gradle test
41
+```
42
+
43
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
44
+
45
+
46
+## Source
47
+
48
+Problem 4 at Project Euler [http://projecteuler.net/problem=4](http://projecteuler.net/problem=4)
49
+
50
+## Submitting Incomplete Solutions
51
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
52
+

+ 17
- 0
exercises/pangram/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,27 @@
1
+# Pangram
2
+
3
+Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
4
+"every letter") is a sentence using every letter of the alphabet at least once.
5
+The best known English pangram is: 
6
+> The quick brown fox jumps over the lazy dog.
7
+
8
+The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case
9
+insensitive. Input will not contain non-ASCII symbols.
10
+
11
+
12
+To run the tests:
13
+
14
+```sh
15
+$ gradle test
16
+```
17
+
18
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
19
+
20
+
21
+## Source
22
+
23
+Wikipedia [https://en.wikipedia.org/wiki/Pangram](https://en.wikipedia.org/wiki/Pangram)
24
+
25
+## Submitting Incomplete Solutions
26
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
27
+

+ 17
- 0
exercises/pascals-triangle/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,33 @@
1
+# Pascals Triangle
2
+
3
+Compute Pascal's triangle up to a given number of rows.
4
+
5
+In Pascal's Triangle each number is computed by adding the numbers to
6
+the right and left of the current position in the previous row.
7
+
8
+```plain
9
+    1
10
+   1 1
11
+  1 2 1
12
+ 1 3 3 1
13
+1 4 6 4 1
14
+# ... etc
15
+```
16
+
17
+
18
+To run the tests:
19
+
20
+```sh
21
+$ gradle test
22
+```
23
+
24
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
25
+
26
+
27
+## Source
28
+
29
+Pascal's Triangle at Wolfram Math World [http://mathworld.wolfram.com/PascalsTriangle.html](http://mathworld.wolfram.com/PascalsTriangle.html)
30
+
31
+## Submitting Incomplete Solutions
32
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
33
+

+ 17
- 0
exercises/perfect-numbers/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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

@@ -0,0 +1,36 @@
1
+# Perfect Numbers
2
+
3
+Determine if a number is perfect, abundant, or deficient based on
4
+Nicomachus' (60 - 120 CE) classification scheme for natural numbers.
5
+
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
+
8
+- **Perfect**: aliquot sum = number 
9
+  - 6 is a perfect number because (1 + 2 + 3) = 6
10
+  - 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
11
+- **Abundant**: aliquot sum > number
12
+  - 12 is an abundant number because (1 + 2 + 3 + 4 + 6) = 16
13
+  - 24 is an abundant number because (1 + 2 + 3 + 4 + 6 + 8 + 12) = 36
14
+- **Deficient**: aliquot sum < number
15
+  - 8 is a deficient number because (1 + 2 + 4) = 7
16
+  - Prime numbers are deficient
17
+  
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
+
20
+
21
+To run the tests:
22
+
23
+```sh
24
+$ gradle test
25
+```
26
+
27
+For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
28
+
29
+
30
+## Source
31
+
32
+Taken from Chapter 2 of Functional Thinking by Neal Ford. [http://shop.oreilly.com/product/0636920029687.do](http://shop.oreilly.com/product/0636920029687.do)
33
+
34
+## Submitting Incomplete Solutions
35
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
36
+

+ 17
- 0
exercises/phone-number/.meta/readme.go.tmpl Просмотреть файл

@@ -0,0 +1,17 @@
1
+# {{ .Spec.Name }}
2
+
3
+{{ .Spec.Description -}}
4
+{{- with .Hints }}
5
+{{ . }}
6
+{{ end }}
7
+{{- with .TrackInsert }}
8
+{{ . }}
9
+{{ end }}
10
+{{- with .Spec.Credits -}}
11
+## Source
12
+
13
+{{ . }}
14
+{{ end }}
15
+## Submitting Incomplete Solutions
16
+It's possible to submit an incomplete solution so you can see how others have completed the exercise.
17
+

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


Некоторые файлы не были показаны из-за большого количества измененных файлов