trackler 2.2.1.94 → 2.2.1.95

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/anagram/canonical-data.json +1 -37
  4. data/tracks/crystal/exercises/hello-world/{HINTS.md → .meta/hints.md} +0 -0
  5. data/tracks/java/exercises/prime-factors/.meta/hints.md +58 -0
  6. data/tracks/java/exercises/prime-factors/README.md +62 -0
  7. data/tracks/java/exercises/robot-name/.meta/hints.md +58 -0
  8. data/tracks/java/exercises/robot-name/README.md +62 -0
  9. data/tracks/java/exercises/robot-simulator/src/test/java/RobotTest.java +9 -5
  10. data/tracks/java/exercises/run-length-encoding/.meta/hints.md +58 -0
  11. data/tracks/java/exercises/run-length-encoding/README.md +62 -0
  12. data/tracks/javascript/config/exercise_readme.go.tmpl +26 -4
  13. data/tracks/javascript/exercises/accumulate/README.md +16 -16
  14. data/tracks/javascript/exercises/acronym/README.md +15 -13
  15. data/tracks/javascript/exercises/all-your-base/README.md +16 -14
  16. data/tracks/javascript/exercises/allergies/README.md +15 -13
  17. data/tracks/javascript/exercises/alphametics/README.md +17 -15
  18. data/tracks/javascript/exercises/anagram/README.md +15 -12
  19. data/tracks/javascript/exercises/atbash-cipher/README.md +17 -13
  20. data/tracks/javascript/exercises/beer-song/README.md +17 -14
  21. data/tracks/javascript/exercises/binary/README.md +17 -12
  22. data/tracks/javascript/exercises/binary-search/README.md +15 -12
  23. data/tracks/javascript/exercises/binary-search-tree/README.md +15 -12
  24. data/tracks/javascript/exercises/bob/README.md +17 -12
  25. data/tracks/javascript/exercises/bowling/README.md +38 -21
  26. data/tracks/javascript/exercises/bracket-push/README.md +15 -12
  27. data/tracks/javascript/exercises/change/README.md +31 -17
  28. data/tracks/javascript/exercises/circular-buffer/README.md +28 -18
  29. data/tracks/javascript/exercises/clock/README.md +15 -12
  30. data/tracks/javascript/exercises/collatz-conjecture/README.md +15 -12
  31. data/tracks/javascript/exercises/connect/README.md +17 -16
  32. data/tracks/javascript/exercises/crypto-square/README.md +25 -20
  33. data/tracks/javascript/exercises/custom-set/README.md +15 -13
  34. data/tracks/javascript/exercises/diamond/README.md +21 -18
  35. data/tracks/javascript/exercises/difference-of-squares/README.md +16 -13
  36. data/tracks/javascript/exercises/diffie-hellman/README.md +15 -17
  37. data/tracks/javascript/exercises/etl/README.md +18 -13
  38. data/tracks/javascript/exercises/flatten-array/README.md +16 -14
  39. data/tracks/javascript/exercises/food-chain/README.md +16 -13
  40. data/tracks/javascript/exercises/forth/README.md +17 -18
  41. data/tracks/javascript/exercises/gigasecond/README.md +15 -12
  42. data/tracks/javascript/exercises/grade-school/README.md +15 -13
  43. data/tracks/javascript/exercises/grains/README.md +15 -13
  44. data/tracks/javascript/exercises/hamming/README.md +15 -12
  45. data/tracks/javascript/exercises/hello-world/README.md +15 -12
  46. data/tracks/javascript/exercises/hexadecimal/README.md +15 -12
  47. data/tracks/javascript/exercises/isbn-verifier/README.md +44 -36
  48. data/tracks/javascript/exercises/isogram/README.md +17 -13
  49. data/tracks/javascript/exercises/kindergarten-garden/README.md +28 -25
  50. data/tracks/javascript/exercises/largest-series-product/README.md +15 -12
  51. data/tracks/javascript/exercises/leap/README.md +16 -13
  52. data/tracks/javascript/exercises/linked-list/README.md +25 -22
  53. data/tracks/javascript/exercises/list-ops/README.md +15 -13
  54. data/tracks/javascript/exercises/luhn/README.md +22 -19
  55. data/tracks/javascript/exercises/matrix/README.md +21 -16
  56. data/tracks/javascript/exercises/meetup/README.md +31 -25
  57. data/tracks/javascript/exercises/minesweeper/README.md +15 -13
  58. data/tracks/javascript/exercises/nth-prime/README.md +15 -12
  59. data/tracks/javascript/exercises/nucleotide-count/README.md +23 -34
  60. data/tracks/javascript/exercises/ocr-numbers/README.md +21 -18
  61. data/tracks/javascript/exercises/octal/README.md +21 -14
  62. data/tracks/javascript/exercises/palindrome-products/README.md +29 -27
  63. data/tracks/javascript/exercises/pangram/README.md +16 -13
  64. data/tracks/javascript/exercises/pascals-triangle/README.md +17 -14
  65. data/tracks/javascript/exercises/perfect-numbers/README.md +17 -14
  66. data/tracks/javascript/exercises/phone-number/README.md +19 -15
  67. data/tracks/javascript/exercises/pig-latin/README.md +15 -12
  68. data/tracks/javascript/exercises/point-mutations/README.md +15 -12
  69. data/tracks/javascript/exercises/prime-factors/README.md +15 -12
  70. data/tracks/javascript/exercises/protein-translation/README.md +19 -17
  71. data/tracks/javascript/exercises/proverb/README.md +29 -21
  72. data/tracks/javascript/exercises/pythagorean-triplet/README.md +18 -15
  73. data/tracks/javascript/exercises/queen-attack/README.md +16 -13
  74. data/tracks/javascript/exercises/raindrops/README.md +15 -12
  75. data/tracks/javascript/exercises/reverse-string/README.md +19 -15
  76. data/tracks/javascript/exercises/rna-transcription/README.md +16 -13
  77. data/tracks/javascript/exercises/robot-name/README.md +15 -12
  78. data/tracks/javascript/exercises/robot-simulator/README.md +15 -12
  79. data/tracks/javascript/exercises/roman-numerals/README.md +16 -13
  80. data/tracks/javascript/exercises/run-length-encoding/README.md +19 -16
  81. data/tracks/javascript/exercises/saddle-points/README.md +16 -13
  82. data/tracks/javascript/exercises/say/README.md +15 -12
  83. data/tracks/javascript/exercises/scrabble-score/README.md +18 -13
  84. data/tracks/javascript/exercises/secret-handshake/README.md +16 -13
  85. data/tracks/javascript/exercises/series/README.md +15 -12
  86. data/tracks/javascript/exercises/sieve/README.md +15 -12
  87. data/tracks/javascript/exercises/simple-cipher/README.md +19 -18
  88. data/tracks/javascript/exercises/simple-linked-list/README.md +15 -12
  89. data/tracks/javascript/exercises/space-age/README.md +16 -13
  90. data/tracks/javascript/exercises/strain/README.md +15 -12
  91. data/tracks/javascript/exercises/sublist/README.md +14 -17
  92. data/tracks/javascript/exercises/sum-of-multiples/README.md +19 -19
  93. data/tracks/javascript/exercises/transpose/README.md +15 -12
  94. data/tracks/javascript/exercises/triangle/README.md +24 -18
  95. data/tracks/javascript/exercises/trinary/README.md +16 -13
  96. data/tracks/javascript/exercises/twelve-days/README.md +17 -16
  97. data/tracks/javascript/exercises/two-bucket/README.md +25 -22
  98. data/tracks/javascript/exercises/two-fer/README.md +19 -14
  99. data/tracks/javascript/exercises/word-count/README.md +16 -14
  100. data/tracks/javascript/exercises/wordy/README.md +15 -17
  101. data/tracks/javascript/exercises/zipper/README.md +20 -18
  102. data/tracks/perl6/docs/ABOUT.md +12 -21
  103. metadata +6 -4
  104. data/tracks/javascript/docs/EXERCISE_README_INSERT.md +0 -22
@@ -3,36 +3,38 @@
3
3
  Take a nested list and return a single flattened list with all values except nil/null.
4
4
 
5
5
  The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
6
-
6
+
7
7
  For Example
8
8
 
9
9
  input: [1,[2,3,null,4],[null],5]
10
10
 
11
11
  output: [1,2,3,4,5]
12
12
 
13
-
14
13
  ## Setup
15
14
 
16
- Go through the setup instructions for JavaScript to
17
- install the necessary dependencies:
15
+ Go through the setup instructions for JavaScript to install the
16
+ necessary dependencies:
18
17
 
19
18
  http://exercism.io/languages/javascript/installation
20
19
 
21
- ## Making the Test Suite Pass
22
-
23
- Execute the tests with:
20
+ ## Running the test suite
24
21
 
25
- jasmine <exercise-name>.spec.js
22
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
23
+ You can install it by opening a terminal window and running the
24
+ following command:
26
25
 
27
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
28
- test the Hello World exercise:
26
+ ```sh
27
+ npm install -g jasmine
28
+ ```
29
29
 
30
- jasmine hello-world.spec.js
30
+ Run the test suite from the exercise directory with:
31
31
 
32
- In many test suites all but the first test have been skipped.
32
+ ```sh
33
+ jasmine flatten-array.spec.js
34
+ ```
33
35
 
34
- Once you get a test passing, you can unskip the next one by
35
- changing `xit` to `it`.
36
+ In many test suites all but the first test have been marked "pending".
37
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
36
38
 
37
39
  ## Source
38
40
 
@@ -10,7 +10,7 @@ This is a [cumulative song](http://en.wikipedia.org/wiki/Cumulative_song) of unk
10
10
 
11
11
  This is one of many common variants.
12
12
 
13
- ```plain
13
+ ```text
14
14
  I know an old lady who swallowed a fly.
15
15
  I don't know why she swallowed the fly. Perhaps she'll die.
16
16
 
@@ -65,26 +65,29 @@ She's dead, of course!
65
65
 
66
66
  ## Setup
67
67
 
68
- Go through the setup instructions for JavaScript to
69
- install the necessary dependencies:
68
+ Go through the setup instructions for JavaScript to install the
69
+ necessary dependencies:
70
70
 
71
71
  http://exercism.io/languages/javascript/installation
72
72
 
73
- ## Making the Test Suite Pass
73
+ ## Running the test suite
74
74
 
75
- Execute the tests with:
75
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
76
+ You can install it by opening a terminal window and running the
77
+ following command:
76
78
 
77
- jasmine <exercise-name>.spec.js
78
-
79
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
80
- test the Hello World exercise:
79
+ ```sh
80
+ npm install -g jasmine
81
+ ```
81
82
 
82
- jasmine hello-world.spec.js
83
+ Run the test suite from the exercise directory with:
83
84
 
84
- In many test suites all but the first test have been skipped.
85
+ ```sh
86
+ jasmine food-chain.spec.js
87
+ ```
85
88
 
86
- Once you get a test passing, you can unskip the next one by
87
- changing `xit` to `it`.
89
+ In many test suites all but the first test have been marked "pending".
90
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
88
91
 
89
92
  ## Source
90
93
 
@@ -1,3 +1,5 @@
1
+ # Forth
2
+
1
3
  Implement an evaluator for a very simple subset of Forth.
2
4
 
3
5
  [Forth](https://en.wikipedia.org/wiki/Forth_%28programming_language%29)
@@ -25,32 +27,29 @@ Words are case-insensitive.
25
27
 
26
28
  ## Setup
27
29
 
28
- Go through the setup instructions for JavaScript to
29
- install the necessary dependencies:
30
+ Go through the setup instructions for JavaScript to install the
31
+ necessary dependencies:
30
32
 
31
33
  http://exercism.io/languages/javascript/installation
32
34
 
33
- ## Making the Test Suite Pass
34
-
35
- Execute the tests with:
36
-
37
- jasmine <exercise-name>.spec.js
38
-
39
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
40
- test the Hello World exercise:
35
+ ## Running the test suite
41
36
 
42
- jasmine hello-world.spec.js
37
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
38
+ You can install it by opening a terminal window and running the
39
+ following command:
43
40
 
44
- In many test suites all but the first test have been skipped.
41
+ ```sh
42
+ npm install -g jasmine
43
+ ```
45
44
 
46
- Once you get a test passing, you can unskip the next one by
47
- changing `xit` to `it`.
45
+ Run the test suite from the exercise directory with:
48
46
 
49
- ## Source
47
+ ```sh
48
+ jasmine forth.spec.js
49
+ ```
50
50
 
51
- Wikipedia
52
- [Stack-oriented programming language](https://en.wikipedia.org/wiki/Stack-oriented_programming_language)
53
- [Forth programming language](https://en.wikipedia.org/wiki/Forth_(programming_language))
51
+ In many test suites all but the first test have been marked "pending".
52
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
54
53
 
55
54
  ## Submitting Incomplete Solutions
56
55
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -6,26 +6,29 @@ A gigasecond is 10^9 (1,000,000,000) seconds.
6
6
 
7
7
  ## Setup
8
8
 
9
- Go through the setup instructions for JavaScript to
10
- install the necessary dependencies:
9
+ Go through the setup instructions for JavaScript to install the
10
+ necessary dependencies:
11
11
 
12
12
  http://exercism.io/languages/javascript/installation
13
13
 
14
- ## Making the Test Suite Pass
14
+ ## Running the test suite
15
15
 
16
- Execute the tests with:
16
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
17
+ You can install it by opening a terminal window and running the
18
+ following command:
17
19
 
18
- jasmine <exercise-name>.spec.js
20
+ ```sh
21
+ npm install -g jasmine
22
+ ```
19
23
 
20
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
21
- test the Hello World exercise:
24
+ Run the test suite from the exercise directory with:
22
25
 
23
- jasmine hello-world.spec.js
26
+ ```sh
27
+ jasmine gigasecond.spec.js
28
+ ```
24
29
 
25
- In many test suites all but the first test have been skipped.
26
-
27
- Once you get a test passing, you can unskip the next one by
28
- changing `xit` to `it`.
30
+ In many test suites all but the first test have been marked "pending".
31
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
29
32
 
30
33
  ## Source
31
34
 
@@ -21,7 +21,6 @@ In the end, you should be able to:
21
21
  Note that all our students only have one name. (It's a small town, what
22
22
  do you want?)
23
23
 
24
-
25
24
  ## For bonus points
26
25
 
27
26
  Did you get the tests passing and the code clean? If you want to, these
@@ -37,26 +36,29 @@ experiment make the code better? Worse? Did you learn anything from it?
37
36
 
38
37
  ## Setup
39
38
 
40
- Go through the setup instructions for JavaScript to
41
- install the necessary dependencies:
39
+ Go through the setup instructions for JavaScript to install the
40
+ necessary dependencies:
42
41
 
43
42
  http://exercism.io/languages/javascript/installation
44
43
 
45
- ## Making the Test Suite Pass
46
-
47
- Execute the tests with:
44
+ ## Running the test suite
48
45
 
49
- jasmine <exercise-name>.spec.js
46
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
47
+ You can install it by opening a terminal window and running the
48
+ following command:
50
49
 
51
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
52
- test the Hello World exercise:
50
+ ```sh
51
+ npm install -g jasmine
52
+ ```
53
53
 
54
- jasmine hello-world.spec.js
54
+ Run the test suite from the exercise directory with:
55
55
 
56
- In many test suites all but the first test have been skipped.
56
+ ```sh
57
+ jasmine grade-school.spec.js
58
+ ```
57
59
 
58
- Once you get a test passing, you can unskip the next one by
59
- changing `xit` to `it`.
60
+ In many test suites all but the first test have been marked "pending".
61
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
60
62
 
61
63
  ## Source
62
64
 
@@ -15,7 +15,6 @@ Write code that shows:
15
15
  - how many grains were on each square, and
16
16
  - the total number of grains
17
17
 
18
-
19
18
  ## For bonus points
20
19
 
21
20
  Did you get the tests passing and the code clean? If you want to, these
@@ -29,26 +28,29 @@ experiment make the code better? Worse? Did you learn anything from it?
29
28
 
30
29
  ## Setup
31
30
 
32
- Go through the setup instructions for JavaScript to
33
- install the necessary dependencies:
31
+ Go through the setup instructions for JavaScript to install the
32
+ necessary dependencies:
34
33
 
35
34
  http://exercism.io/languages/javascript/installation
36
35
 
37
- ## Making the Test Suite Pass
38
-
39
- Execute the tests with:
36
+ ## Running the test suite
40
37
 
41
- jasmine <exercise-name>.spec.js
38
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
39
+ You can install it by opening a terminal window and running the
40
+ following command:
42
41
 
43
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
44
- test the Hello World exercise:
42
+ ```sh
43
+ npm install -g jasmine
44
+ ```
45
45
 
46
- jasmine hello-world.spec.js
46
+ Run the test suite from the exercise directory with:
47
47
 
48
- In many test suites all but the first test have been skipped.
48
+ ```sh
49
+ jasmine grains.spec.js
50
+ ```
49
51
 
50
- Once you get a test passing, you can unskip the next one by
51
- changing `xit` to `it`.
52
+ In many test suites all but the first test have been marked "pending".
53
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
52
54
 
53
55
  ## Source
54
56
 
@@ -37,26 +37,29 @@ of equal length differently.
37
37
 
38
38
  ## Setup
39
39
 
40
- Go through the setup instructions for JavaScript to
41
- install the necessary dependencies:
40
+ Go through the setup instructions for JavaScript to install the
41
+ necessary dependencies:
42
42
 
43
43
  http://exercism.io/languages/javascript/installation
44
44
 
45
- ## Making the Test Suite Pass
45
+ ## Running the test suite
46
46
 
47
- Execute the tests with:
47
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
48
+ You can install it by opening a terminal window and running the
49
+ following command:
48
50
 
49
- jasmine <exercise-name>.spec.js
51
+ ```sh
52
+ npm install -g jasmine
53
+ ```
50
54
 
51
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
52
- test the Hello World exercise:
55
+ Run the test suite from the exercise directory with:
53
56
 
54
- jasmine hello-world.spec.js
57
+ ```sh
58
+ jasmine hamming.spec.js
59
+ ```
55
60
 
56
- In many test suites all but the first test have been skipped.
57
-
58
- Once you get a test passing, you can unskip the next one by
59
- changing `xit` to `it`.
61
+ In many test suites all but the first test have been marked "pending".
62
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
60
63
 
61
64
  ## Source
62
65
 
@@ -103,26 +103,29 @@ When you are done, submit your solution to exercism:
103
103
 
104
104
  ## Setup
105
105
 
106
- Go through the setup instructions for JavaScript to
107
- install the necessary dependencies:
106
+ Go through the setup instructions for JavaScript to install the
107
+ necessary dependencies:
108
108
 
109
109
  http://exercism.io/languages/javascript/installation
110
110
 
111
- ## Making the Test Suite Pass
111
+ ## Running the test suite
112
112
 
113
- Execute the tests with:
113
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
114
+ You can install it by opening a terminal window and running the
115
+ following command:
114
116
 
115
- jasmine <exercise-name>.spec.js
117
+ ```sh
118
+ npm install -g jasmine
119
+ ```
116
120
 
117
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
118
- test the Hello World exercise:
121
+ Run the test suite from the exercise directory with:
119
122
 
120
- jasmine hello-world.spec.js
121
-
122
- In many test suites all but the first test have been skipped.
123
+ ```sh
124
+ jasmine hello-world.spec.js
125
+ ```
123
126
 
124
- Once you get a test passing, you can unskip the next one by
125
- changing `xit` to `it`.
127
+ In many test suites all but the first test have been marked "pending".
128
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
126
129
 
127
130
  ## Source
128
131
 
@@ -9,26 +9,29 @@ The program should handle invalid hexadecimal strings.
9
9
 
10
10
  ## Setup
11
11
 
12
- Go through the setup instructions for JavaScript to
13
- install the necessary dependencies:
12
+ Go through the setup instructions for JavaScript to install the
13
+ necessary dependencies:
14
14
 
15
15
  http://exercism.io/languages/javascript/installation
16
16
 
17
- ## Making the Test Suite Pass
17
+ ## Running the test suite
18
18
 
19
- Execute the tests with:
19
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
20
+ You can install it by opening a terminal window and running the
21
+ following command:
20
22
 
21
- jasmine <exercise-name>.spec.js
23
+ ```sh
24
+ npm install -g jasmine
25
+ ```
22
26
 
23
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
24
- test the Hello World exercise:
27
+ Run the test suite from the exercise directory with:
25
28
 
26
- jasmine hello-world.spec.js
29
+ ```sh
30
+ jasmine hexadecimal.spec.js
31
+ ```
27
32
 
28
- In many test suites all but the first test have been skipped.
29
-
30
- Once you get a test passing, you can unskip the next one by
31
- changing `xit` to `it`.
33
+ In many test suites all but the first test have been marked "pending".
34
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
32
35
 
33
36
  ## Source
34
37
 
@@ -1,66 +1,74 @@
1
- # ISBN Verifier
1
+ # Isbn Verifier
2
2
 
3
- Check if a given ISBN-10 is valid.
3
+ The [ISBN-10 verification process](https://en.wikipedia.org/wiki/International_Standard_Book_Number) is used to validate book identification
4
+ numbers. These normally contain dashes and look like: `3-598-21508-8`
4
5
 
5
- ## Functionality
6
+ ## ISBN
6
7
 
7
- Given an unknown string the program should check if the provided string is a valid ISBN-10.
8
- Putting this into place requires some thinking about preprocessing/parsing of the string prior to calculating the check digit for the ISBN.
8
+ The ISBN-10 format is 9 digits (0 to 9) plus one check character (either a digit or an X only). In the case the check character is an X, this represents the value '10'. These may be communicated with or without hyphens, and can be checked for their validity by the following formula:
9
9
 
10
- The program should allow for ISBN-10 without the separating dashes to be verified as well.
10
+ ```
11
+ (x1 * 10 + x2 * 9 + x3 * 8 + x4 * 7 + x5 * 6 + x6 * 5 + x7 * 4 + x8 * 3 + x9 * 2 + x10 * 1) mod 11 == 0
12
+ ```
11
13
 
12
- ## ISBN
14
+ If the result is 0, then it is a valid ISBN-10, otherwise it is invalid.
13
15
 
14
- Let's take a random ISBN-10 number, say `3-598-21508-8` for this.
15
- The first digit block indicates the group where the ISBN belongs. Groups can consist of shared languages, geographic regions or countries. The leading '3' signals this ISBN is from a german speaking country.
16
- The following number block is to identify the publisher. Since this is a three digit publisher number there is a 5 digit title number for this book.
17
- The last digit in the ISBN is the check digit which is used to detect read errors.
16
+ ## Example
18
17
 
19
- The first 9 digits in the ISBN have to be between 0 and 9.
20
- The check digit can additionally be an 'X' to allow 10 to be a valid check digit as well.
18
+ Let's take the ISBN-10 `3-598-21508-8`. We plug it in to the formula, and get:
19
+ ```
20
+ (3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 1 * 5 + 5 * 4 + 0 * 3 + 8 * 2 + 8 * 1) mod 11 == 0
21
+ ```
21
22
 
22
- A valid ISBN-10 is calculated with this formula `(x1 * 10 + x2 * 9 + x3 * 8 + x4 * 7 + x5 * 6 + x6 * 5 + x7 * 4 + x8 * 3 + x9 * 2 + x10 * 1) mod 11 == 0`
23
- So for our example ISBN this means:
24
- (3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 1 * 5 + 5 * 4 + 0 * 3 + 8 * 2 + 8 * 1) mod 11 = 0
23
+ Since the result is 0, this proves that our ISBN is valid.
25
24
 
26
- Which proves that the ISBN is valid.
25
+ ## Task
27
26
 
28
- ## Setup
27
+ Given a string the program should check if the provided string is a valid ISBN-10.
28
+ Putting this into place requires some thinking about preprocessing/parsing of the string prior to calculating the check digit for the ISBN.
29
+
30
+ The program should be able to verify ISBN-10 both with and without separating dashes.
29
31
 
30
- Go through the setup instructions for JavaScript to
31
- install the necessary dependencies:
32
32
 
33
- http://exercism.io/languages/javascript
33
+ ## Caveats
34
34
 
35
- ## Making the Test Suite Pass
35
+ Converting from strings to numbers can be tricky in certain languages.
36
+ Now, it's even trickier since the check digit of an ISBN-10 may be 'X' (representing '10'). For instance `3-598-21507-X` is a valid ISBN-10.
36
37
 
37
- Execute the tests with:
38
+ ## Bonus tasks
38
39
 
39
- jasmine <exercise-name>.spec.js
40
+ * Generate a valid ISBN-13 from the input ISBN-10 (and maybe verify it again with a derived verifier).
40
41
 
41
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
42
- test the Hello World exercise:
42
+ * Generate valid ISBN, maybe even from a given starting ISBN.
43
+ ## Setup
43
44
 
44
- jasmine hello-world.spec.js
45
+ Go through the setup instructions for JavaScript to install the
46
+ necessary dependencies:
45
47
 
46
- In many test suites all but the first test have been skipped.
48
+ http://exercism.io/languages/javascript/installation
47
49
 
48
- Once you get a test passing, you can unskip the next one by
49
- changing `xit` to `it`.
50
+ ## Running the test suite
50
51
 
51
- ### Submitting Exercises
52
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
53
+ You can install it by opening a terminal window and running the
54
+ following command:
52
55
 
53
- Note that, when trying to submit an exercise, make sure the solution is in the `exercism/javascript/<exerciseName>` directory.
56
+ ```sh
57
+ npm install -g jasmine
58
+ ```
54
59
 
55
- For example, if you're submitting `bob.js` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/javascript/bob/bob.js`.
60
+ Run the test suite from the exercise directory with:
56
61
 
62
+ ```sh
63
+ jasmine isbn-verifier.spec.js
64
+ ```
57
65
 
58
- For more detailed information about running tests, code style and linting,
59
- please see the [help page](http://exercism.io/languages/javascript).
66
+ In many test suites all but the first test have been marked "pending".
67
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
60
68
 
61
69
  ## Source
62
70
 
63
- Converting a string into a number and some basic processing utilizing a relatable real world example. [https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation](https://en.wikipedia.org/wiki/International_Standard_Book_Number)
71
+ Converting a string into a number and some basic processing utilizing a relatable real world example. [https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation](https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation)
64
72
 
65
73
  ## Submitting Incomplete Solutions
66
74
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -2,38 +2,42 @@
2
2
 
3
3
  Determine if a word or phrase is an isogram.
4
4
 
5
- An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
5
+ An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.
6
6
 
7
7
  Examples of isograms:
8
8
 
9
9
  - lumberjacks
10
10
  - background
11
11
  - downstream
12
+ - six-year-old
12
13
 
13
14
  The word *isograms*, however, is not an isogram, because the s repeats.
14
15
 
15
16
  ## Setup
16
17
 
17
- Go through the setup instructions for JavaScript to
18
- install the necessary dependencies:
18
+ Go through the setup instructions for JavaScript to install the
19
+ necessary dependencies:
19
20
 
20
21
  http://exercism.io/languages/javascript/installation
21
22
 
22
- ## Making the Test Suite Pass
23
+ ## Running the test suite
23
24
 
24
- Execute the tests with:
25
+ The provided test suite uses [Jasmine](https://jasmine.github.io/).
26
+ You can install it by opening a terminal window and running the
27
+ following command:
25
28
 
26
- jasmine <exercise-name>.spec.js
29
+ ```sh
30
+ npm install -g jasmine
31
+ ```
27
32
 
28
- Replace `<exercise-name>` with the name of the current exercise. E.g., to
29
- test the Hello World exercise:
33
+ Run the test suite from the exercise directory with:
30
34
 
31
- jasmine hello-world.spec.js
35
+ ```sh
36
+ jasmine isogram.spec.js
37
+ ```
32
38
 
33
- In many test suites all but the first test have been skipped.
34
-
35
- Once you get a test passing, you can unskip the next one by
36
- changing `xit` to `it`.
39
+ In many test suites all but the first test have been marked "pending".
40
+ Once you get a test passing, activate the next one by changing `xit` to `it`.
37
41
 
38
42
  ## Source
39
43