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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/anagram/canonical-data.json +1 -37
- data/tracks/crystal/exercises/hello-world/{HINTS.md → .meta/hints.md} +0 -0
- data/tracks/java/exercises/prime-factors/.meta/hints.md +58 -0
- data/tracks/java/exercises/prime-factors/README.md +62 -0
- data/tracks/java/exercises/robot-name/.meta/hints.md +58 -0
- data/tracks/java/exercises/robot-name/README.md +62 -0
- data/tracks/java/exercises/robot-simulator/src/test/java/RobotTest.java +9 -5
- data/tracks/java/exercises/run-length-encoding/.meta/hints.md +58 -0
- data/tracks/java/exercises/run-length-encoding/README.md +62 -0
- data/tracks/javascript/config/exercise_readme.go.tmpl +26 -4
- data/tracks/javascript/exercises/accumulate/README.md +16 -16
- data/tracks/javascript/exercises/acronym/README.md +15 -13
- data/tracks/javascript/exercises/all-your-base/README.md +16 -14
- data/tracks/javascript/exercises/allergies/README.md +15 -13
- data/tracks/javascript/exercises/alphametics/README.md +17 -15
- data/tracks/javascript/exercises/anagram/README.md +15 -12
- data/tracks/javascript/exercises/atbash-cipher/README.md +17 -13
- data/tracks/javascript/exercises/beer-song/README.md +17 -14
- data/tracks/javascript/exercises/binary/README.md +17 -12
- data/tracks/javascript/exercises/binary-search/README.md +15 -12
- data/tracks/javascript/exercises/binary-search-tree/README.md +15 -12
- data/tracks/javascript/exercises/bob/README.md +17 -12
- data/tracks/javascript/exercises/bowling/README.md +38 -21
- data/tracks/javascript/exercises/bracket-push/README.md +15 -12
- data/tracks/javascript/exercises/change/README.md +31 -17
- data/tracks/javascript/exercises/circular-buffer/README.md +28 -18
- data/tracks/javascript/exercises/clock/README.md +15 -12
- data/tracks/javascript/exercises/collatz-conjecture/README.md +15 -12
- data/tracks/javascript/exercises/connect/README.md +17 -16
- data/tracks/javascript/exercises/crypto-square/README.md +25 -20
- data/tracks/javascript/exercises/custom-set/README.md +15 -13
- data/tracks/javascript/exercises/diamond/README.md +21 -18
- data/tracks/javascript/exercises/difference-of-squares/README.md +16 -13
- data/tracks/javascript/exercises/diffie-hellman/README.md +15 -17
- data/tracks/javascript/exercises/etl/README.md +18 -13
- data/tracks/javascript/exercises/flatten-array/README.md +16 -14
- data/tracks/javascript/exercises/food-chain/README.md +16 -13
- data/tracks/javascript/exercises/forth/README.md +17 -18
- data/tracks/javascript/exercises/gigasecond/README.md +15 -12
- data/tracks/javascript/exercises/grade-school/README.md +15 -13
- data/tracks/javascript/exercises/grains/README.md +15 -13
- data/tracks/javascript/exercises/hamming/README.md +15 -12
- data/tracks/javascript/exercises/hello-world/README.md +15 -12
- data/tracks/javascript/exercises/hexadecimal/README.md +15 -12
- data/tracks/javascript/exercises/isbn-verifier/README.md +44 -36
- data/tracks/javascript/exercises/isogram/README.md +17 -13
- data/tracks/javascript/exercises/kindergarten-garden/README.md +28 -25
- data/tracks/javascript/exercises/largest-series-product/README.md +15 -12
- data/tracks/javascript/exercises/leap/README.md +16 -13
- data/tracks/javascript/exercises/linked-list/README.md +25 -22
- data/tracks/javascript/exercises/list-ops/README.md +15 -13
- data/tracks/javascript/exercises/luhn/README.md +22 -19
- data/tracks/javascript/exercises/matrix/README.md +21 -16
- data/tracks/javascript/exercises/meetup/README.md +31 -25
- data/tracks/javascript/exercises/minesweeper/README.md +15 -13
- data/tracks/javascript/exercises/nth-prime/README.md +15 -12
- data/tracks/javascript/exercises/nucleotide-count/README.md +23 -34
- data/tracks/javascript/exercises/ocr-numbers/README.md +21 -18
- data/tracks/javascript/exercises/octal/README.md +21 -14
- data/tracks/javascript/exercises/palindrome-products/README.md +29 -27
- data/tracks/javascript/exercises/pangram/README.md +16 -13
- data/tracks/javascript/exercises/pascals-triangle/README.md +17 -14
- data/tracks/javascript/exercises/perfect-numbers/README.md +17 -14
- data/tracks/javascript/exercises/phone-number/README.md +19 -15
- data/tracks/javascript/exercises/pig-latin/README.md +15 -12
- data/tracks/javascript/exercises/point-mutations/README.md +15 -12
- data/tracks/javascript/exercises/prime-factors/README.md +15 -12
- data/tracks/javascript/exercises/protein-translation/README.md +19 -17
- data/tracks/javascript/exercises/proverb/README.md +29 -21
- data/tracks/javascript/exercises/pythagorean-triplet/README.md +18 -15
- data/tracks/javascript/exercises/queen-attack/README.md +16 -13
- data/tracks/javascript/exercises/raindrops/README.md +15 -12
- data/tracks/javascript/exercises/reverse-string/README.md +19 -15
- data/tracks/javascript/exercises/rna-transcription/README.md +16 -13
- data/tracks/javascript/exercises/robot-name/README.md +15 -12
- data/tracks/javascript/exercises/robot-simulator/README.md +15 -12
- data/tracks/javascript/exercises/roman-numerals/README.md +16 -13
- data/tracks/javascript/exercises/run-length-encoding/README.md +19 -16
- data/tracks/javascript/exercises/saddle-points/README.md +16 -13
- data/tracks/javascript/exercises/say/README.md +15 -12
- data/tracks/javascript/exercises/scrabble-score/README.md +18 -13
- data/tracks/javascript/exercises/secret-handshake/README.md +16 -13
- data/tracks/javascript/exercises/series/README.md +15 -12
- data/tracks/javascript/exercises/sieve/README.md +15 -12
- data/tracks/javascript/exercises/simple-cipher/README.md +19 -18
- data/tracks/javascript/exercises/simple-linked-list/README.md +15 -12
- data/tracks/javascript/exercises/space-age/README.md +16 -13
- data/tracks/javascript/exercises/strain/README.md +15 -12
- data/tracks/javascript/exercises/sublist/README.md +14 -17
- data/tracks/javascript/exercises/sum-of-multiples/README.md +19 -19
- data/tracks/javascript/exercises/transpose/README.md +15 -12
- data/tracks/javascript/exercises/triangle/README.md +24 -18
- data/tracks/javascript/exercises/trinary/README.md +16 -13
- data/tracks/javascript/exercises/twelve-days/README.md +17 -16
- data/tracks/javascript/exercises/two-bucket/README.md +25 -22
- data/tracks/javascript/exercises/two-fer/README.md +19 -14
- data/tracks/javascript/exercises/word-count/README.md +16 -14
- data/tracks/javascript/exercises/wordy/README.md +15 -17
- data/tracks/javascript/exercises/zipper/README.md +20 -18
- data/tracks/perl6/docs/ABOUT.md +12 -21
- metadata +6 -4
- data/tracks/javascript/docs/EXERCISE_README_INSERT.md +0 -22
@@ -1,53 +1,42 @@
|
|
1
1
|
# Nucleotide Count
|
2
2
|
|
3
|
-
Given a DNA string, compute how many times each nucleotide occurs in the string.
|
3
|
+
Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Each symbol represents a nucleotide, which is a fancy name for the
|
9
|
-
particular molecules that happen to make up a large part of DNA.
|
10
|
-
|
11
|
-
Shortest intro to biochemistry EVAR:
|
5
|
+
The genetic language of every living thing on the planet is DNA.
|
6
|
+
DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides.
|
7
|
+
4 types exist in DNA and these differ only slightly and can be represented as the following symbols: 'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' thymine.
|
12
8
|
|
9
|
+
Here is an analogy:
|
13
10
|
- twigs are to birds nests as
|
14
|
-
- nucleotides are to DNA
|
15
|
-
-
|
16
|
-
-
|
17
|
-
- oh crap lipids
|
18
|
-
|
19
|
-
I'm not going to talk about lipids because they're crazy complex.
|
20
|
-
|
21
|
-
So back to nucleotides.
|
22
|
-
|
23
|
-
DNA contains four types of them: adenine (`A`), cytosine (`C`), guanine
|
24
|
-
(`G`), and thymine (`T`).
|
25
|
-
|
26
|
-
RNA contains a slightly different set of nucleotides, but we don't care
|
27
|
-
about that for now.
|
11
|
+
- nucleotides are to DNA as
|
12
|
+
- legos are to lego houses as
|
13
|
+
- words are to sentences as...
|
28
14
|
|
29
15
|
## Setup
|
30
16
|
|
31
|
-
Go through the setup instructions for JavaScript to
|
32
|
-
|
17
|
+
Go through the setup instructions for JavaScript to install the
|
18
|
+
necessary dependencies:
|
33
19
|
|
34
20
|
http://exercism.io/languages/javascript/installation
|
35
21
|
|
36
|
-
##
|
37
|
-
|
38
|
-
Execute the tests with:
|
22
|
+
## Running the test suite
|
39
23
|
|
40
|
-
|
24
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
25
|
+
You can install it by opening a terminal window and running the
|
26
|
+
following command:
|
41
27
|
|
42
|
-
|
43
|
-
|
28
|
+
```sh
|
29
|
+
npm install -g jasmine
|
30
|
+
```
|
44
31
|
|
45
|
-
|
32
|
+
Run the test suite from the exercise directory with:
|
46
33
|
|
47
|
-
|
34
|
+
```sh
|
35
|
+
jasmine nucleotide-count.spec.js
|
36
|
+
```
|
48
37
|
|
49
|
-
|
50
|
-
changing `xit` to `it`.
|
38
|
+
In many test suites all but the first test have been marked "pending".
|
39
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
51
40
|
|
52
41
|
## Source
|
53
42
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# OCR Numbers
|
2
2
|
|
3
3
|
Given a 3 x 4 grid of pipes, underscores, and spaces, determine which number is
|
4
4
|
represented, or whether it is garbled.
|
@@ -9,7 +9,7 @@ To begin with, convert a simple binary font to a string containing 0 or 1.
|
|
9
9
|
|
10
10
|
The binary font uses pipes and underscores, four rows high and three columns wide.
|
11
11
|
|
12
|
-
```
|
12
|
+
```text
|
13
13
|
_ #
|
14
14
|
| | # zero.
|
15
15
|
|_| #
|
@@ -18,7 +18,7 @@ The binary font uses pipes and underscores, four rows high and three columns wid
|
|
18
18
|
|
19
19
|
Is converted to "0"
|
20
20
|
|
21
|
-
```
|
21
|
+
```text
|
22
22
|
#
|
23
23
|
| # one.
|
24
24
|
| #
|
@@ -39,7 +39,7 @@ Update your program to recognize multi-character binary strings, replacing garbl
|
|
39
39
|
|
40
40
|
Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.
|
41
41
|
|
42
|
-
```
|
42
|
+
```text
|
43
43
|
_
|
44
44
|
_|
|
45
45
|
|_
|
@@ -48,7 +48,7 @@ Update your program to recognize all numbers 0 through 9, both individually and
|
|
48
48
|
|
49
49
|
Is converted to "2"
|
50
50
|
|
51
|
-
```
|
51
|
+
```text
|
52
52
|
_ _ _ _ _ _ _ _ #
|
53
53
|
| _| _||_||_ |_ ||_||_|| | # decimal numbers.
|
54
54
|
||_ _| | _||_| ||_| _||_| #
|
@@ -61,7 +61,7 @@ Is converted to "1234567890"
|
|
61
61
|
|
62
62
|
Update your program to handle multiple numbers, one per line. When converting several lines, join the lines with commas.
|
63
63
|
|
64
|
-
```
|
64
|
+
```text
|
65
65
|
_ _
|
66
66
|
| _| _|
|
67
67
|
||_ _|
|
@@ -80,26 +80,29 @@ Is converted to "123,456,789"
|
|
80
80
|
|
81
81
|
## Setup
|
82
82
|
|
83
|
-
Go through the setup instructions for JavaScript to
|
84
|
-
|
83
|
+
Go through the setup instructions for JavaScript to install the
|
84
|
+
necessary dependencies:
|
85
85
|
|
86
86
|
http://exercism.io/languages/javascript/installation
|
87
87
|
|
88
|
-
##
|
89
|
-
|
90
|
-
Execute the tests with:
|
88
|
+
## Running the test suite
|
91
89
|
|
92
|
-
|
90
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
91
|
+
You can install it by opening a terminal window and running the
|
92
|
+
following command:
|
93
93
|
|
94
|
-
|
95
|
-
|
94
|
+
```sh
|
95
|
+
npm install -g jasmine
|
96
|
+
```
|
96
97
|
|
97
|
-
|
98
|
+
Run the test suite from the exercise directory with:
|
98
99
|
|
99
|
-
|
100
|
+
```sh
|
101
|
+
jasmine ocr-numbers.spec.js
|
102
|
+
```
|
100
103
|
|
101
|
-
|
102
|
-
changing `xit` to `it`.
|
104
|
+
In many test suites all but the first test have been marked "pending".
|
105
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
103
106
|
|
104
107
|
## Source
|
105
108
|
|
@@ -8,11 +8,13 @@ Implement octal to decimal conversion. Given an octal input
|
|
8
8
|
string, your program should produce a decimal output.
|
9
9
|
|
10
10
|
## Note
|
11
|
+
|
11
12
|
- Implement the conversion yourself.
|
12
13
|
Do not use something else to perform the conversion for you.
|
13
14
|
- Treat invalid input as octal 0.
|
14
15
|
|
15
16
|
## About Octal (Base-8)
|
17
|
+
|
16
18
|
Decimal is a base-10 system.
|
17
19
|
|
18
20
|
A number 233 in base 10 notation can be understood
|
@@ -25,7 +27,8 @@ as a linear combination of powers of 10:
|
|
25
27
|
- All these values are summed.
|
26
28
|
|
27
29
|
So:
|
28
|
-
|
30
|
+
|
31
|
+
```text
|
29
32
|
233 # decimal
|
30
33
|
= 2*10^2 + 3*10^1 + 3*10^0
|
31
34
|
= 2*100 + 3*10 + 3*1
|
@@ -34,7 +37,8 @@ So:
|
|
34
37
|
Octal is similar, but uses powers of 8 rather than powers of 10.
|
35
38
|
|
36
39
|
So:
|
37
|
-
|
40
|
+
|
41
|
+
```text
|
38
42
|
233 # octal
|
39
43
|
= 2*8^2 + 3*8^1 + 3*8^0
|
40
44
|
= 2*64 + 3*8 + 3*1
|
@@ -44,26 +48,29 @@ So:
|
|
44
48
|
|
45
49
|
## Setup
|
46
50
|
|
47
|
-
Go through the setup instructions for JavaScript to
|
48
|
-
|
51
|
+
Go through the setup instructions for JavaScript to install the
|
52
|
+
necessary dependencies:
|
49
53
|
|
50
54
|
http://exercism.io/languages/javascript/installation
|
51
55
|
|
52
|
-
##
|
53
|
-
|
54
|
-
Execute the tests with:
|
56
|
+
## Running the test suite
|
55
57
|
|
56
|
-
|
58
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
59
|
+
You can install it by opening a terminal window and running the
|
60
|
+
following command:
|
57
61
|
|
58
|
-
|
59
|
-
|
62
|
+
```sh
|
63
|
+
npm install -g jasmine
|
64
|
+
```
|
60
65
|
|
61
|
-
|
66
|
+
Run the test suite from the exercise directory with:
|
62
67
|
|
63
|
-
|
68
|
+
```sh
|
69
|
+
jasmine octal.spec.js
|
70
|
+
```
|
64
71
|
|
65
|
-
|
66
|
-
changing `xit` to `it`.
|
72
|
+
In many test suites all but the first test have been marked "pending".
|
73
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
67
74
|
|
68
75
|
## Source
|
69
76
|
|
@@ -5,56 +5,58 @@ Detect palindrome products in a given range.
|
|
5
5
|
A palindromic number is a number that remains the same when its digits are
|
6
6
|
reversed. For example, `121` is a palindromic number but `112` is not.
|
7
7
|
|
8
|
-
Given
|
9
|
-
|
10
|
-
`a` and `b` are integers (possibly, but _not_ necessarily palindromic numbers).
|
8
|
+
Given a range of numbers, find the largest and smallest palindromes which
|
9
|
+
are products of numbers within that range.
|
11
10
|
|
12
|
-
|
13
|
-
|
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 its factors.
|
11
|
+
Your solution should return the largest and smallest palindromes, along with the
|
12
|
+
factors of each within the range. If the largest or smallest palindrome has more
|
13
|
+
than one pair of factors within the range, then return all the pairs.
|
21
14
|
|
22
15
|
## Example 1
|
23
16
|
|
24
17
|
Given the range `[1, 9]` (both inclusive)...
|
25
18
|
|
26
|
-
|
27
|
-
|
19
|
+
And given the list of all possible products within this range:
|
20
|
+
`[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 15, 21, 24, 27, 20, 28, 32, 36, 25, 30, 35, 40, 45, 42, 48, 54, 49, 56, 63, 64, 72, 81]`
|
21
|
+
|
22
|
+
The palindrome products are all single digit numbers (in this case):
|
23
|
+
`[1, 2, 3, 4, 5, 6, 7, 8, 9]`
|
24
|
+
|
25
|
+
The smallest palindrome product is `1`. Its factors are `(1, 1)`.
|
26
|
+
The largest palindrome product is `9`. Its factors are `(1, 9)` and `(3, 3)`.
|
28
27
|
|
29
28
|
## Example 2
|
30
29
|
|
31
30
|
Given the range `[10, 99]` (both inclusive)...
|
32
31
|
|
33
32
|
The smallest palindrome product is `121`. Its factors are `(11, 11)`.
|
34
|
-
The largest palindrome product is `9009`. Its factors are `(91, 99)
|
33
|
+
The largest palindrome product is `9009`. Its factors are `(91, 99)`.
|
35
34
|
|
36
35
|
## Setup
|
37
36
|
|
38
|
-
Go through the setup instructions for JavaScript to
|
39
|
-
|
37
|
+
Go through the setup instructions for JavaScript to install the
|
38
|
+
necessary dependencies:
|
40
39
|
|
41
40
|
http://exercism.io/languages/javascript/installation
|
42
41
|
|
43
|
-
##
|
44
|
-
|
45
|
-
Execute the tests with:
|
42
|
+
## Running the test suite
|
46
43
|
|
47
|
-
|
44
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
45
|
+
You can install it by opening a terminal window and running the
|
46
|
+
following command:
|
48
47
|
|
49
|
-
|
50
|
-
|
48
|
+
```sh
|
49
|
+
npm install -g jasmine
|
50
|
+
```
|
51
51
|
|
52
|
-
|
52
|
+
Run the test suite from the exercise directory with:
|
53
53
|
|
54
|
-
|
54
|
+
```sh
|
55
|
+
jasmine palindrome-products.spec.js
|
56
|
+
```
|
55
57
|
|
56
|
-
|
57
|
-
changing `xit` to `it`.
|
58
|
+
In many test suites all but the first test have been marked "pending".
|
59
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
58
60
|
|
59
61
|
## Source
|
60
62
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
|
4
4
|
"every letter") is a sentence using every letter of the alphabet at least once.
|
5
|
-
The best known English pangram is:
|
5
|
+
The best known English pangram is:
|
6
6
|
> The quick brown fox jumps over the lazy dog.
|
7
7
|
|
8
8
|
The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case
|
@@ -10,26 +10,29 @@ insensitive. Input will not contain non-ASCII symbols.
|
|
10
10
|
|
11
11
|
## Setup
|
12
12
|
|
13
|
-
Go through the setup instructions for JavaScript to
|
14
|
-
|
13
|
+
Go through the setup instructions for JavaScript to install the
|
14
|
+
necessary dependencies:
|
15
15
|
|
16
16
|
http://exercism.io/languages/javascript/installation
|
17
17
|
|
18
|
-
##
|
18
|
+
## Running the test suite
|
19
19
|
|
20
|
-
|
20
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
21
|
+
You can install it by opening a terminal window and running the
|
22
|
+
following command:
|
21
23
|
|
22
|
-
|
24
|
+
```sh
|
25
|
+
npm install -g jasmine
|
26
|
+
```
|
23
27
|
|
24
|
-
|
25
|
-
test the Hello World exercise:
|
28
|
+
Run the test suite from the exercise directory with:
|
26
29
|
|
27
|
-
|
30
|
+
```sh
|
31
|
+
jasmine pangram.spec.js
|
32
|
+
```
|
28
33
|
|
29
|
-
In many test suites all but the first test have been
|
30
|
-
|
31
|
-
Once you get a test passing, you can unskip the next one by
|
32
|
-
changing `xit` to `it`.
|
34
|
+
In many test suites all but the first test have been marked "pending".
|
35
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
33
36
|
|
34
37
|
## Source
|
35
38
|
|
@@ -1,11 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# Pascal's Triangle
|
2
2
|
|
3
3
|
Compute Pascal's triangle up to a given number of rows.
|
4
4
|
|
5
5
|
In Pascal's Triangle each number is computed by adding the numbers to
|
6
6
|
the right and left of the current position in the previous row.
|
7
7
|
|
8
|
-
```
|
8
|
+
```text
|
9
9
|
1
|
10
10
|
1 1
|
11
11
|
1 2 1
|
@@ -16,26 +16,29 @@ the right and left of the current position in the previous row.
|
|
16
16
|
|
17
17
|
## Setup
|
18
18
|
|
19
|
-
Go through the setup instructions for JavaScript to
|
20
|
-
|
19
|
+
Go through the setup instructions for JavaScript to install the
|
20
|
+
necessary dependencies:
|
21
21
|
|
22
22
|
http://exercism.io/languages/javascript/installation
|
23
23
|
|
24
|
-
##
|
24
|
+
## Running the test suite
|
25
25
|
|
26
|
-
|
26
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
27
|
+
You can install it by opening a terminal window and running the
|
28
|
+
following command:
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
test the Hello World exercise:
|
30
|
+
```sh
|
31
|
+
npm install -g jasmine
|
32
|
+
```
|
32
33
|
|
33
|
-
|
34
|
+
Run the test suite from the exercise directory with:
|
34
35
|
|
35
|
-
|
36
|
+
```sh
|
37
|
+
jasmine pascals-triangle.spec.js
|
38
|
+
```
|
36
39
|
|
37
|
-
|
38
|
-
changing `xit` to `it`.
|
40
|
+
In many test suites all but the first test have been marked "pending".
|
41
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
39
42
|
|
40
43
|
## Source
|
41
44
|
|
@@ -5,7 +5,7 @@ Nicomachus' (60 - 120 CE) classification scheme for natural numbers.
|
|
5
5
|
|
6
6
|
The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) devised a classification scheme for natural numbers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum](https://en.wikipedia.org/wiki/Aliquot_sum). The aliquot sum is defined as the sum of the factors of a number not including the number itself. For example, the aliquot sum of 15 is (1 + 3 + 5) = 9
|
7
7
|
|
8
|
-
- **Perfect**: aliquot sum = number
|
8
|
+
- **Perfect**: aliquot sum = number
|
9
9
|
- 6 is a perfect number because (1 + 2 + 3) = 6
|
10
10
|
- 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
|
11
11
|
- **Abundant**: aliquot sum > number
|
@@ -14,31 +14,34 @@ The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) d
|
|
14
14
|
- **Deficient**: aliquot sum < number
|
15
15
|
- 8 is a deficient number because (1 + 2 + 4) = 7
|
16
16
|
- Prime numbers are deficient
|
17
|
-
|
17
|
+
|
18
18
|
Implement a way to determine whether a given number is **perfect**. Depending on your language track, you may also need to implement a way to determine whether a given number is **abundant** or **deficient**.
|
19
19
|
|
20
20
|
## Setup
|
21
21
|
|
22
|
-
Go through the setup instructions for JavaScript to
|
23
|
-
|
22
|
+
Go through the setup instructions for JavaScript to install the
|
23
|
+
necessary dependencies:
|
24
24
|
|
25
25
|
http://exercism.io/languages/javascript/installation
|
26
26
|
|
27
|
-
##
|
28
|
-
|
29
|
-
Execute the tests with:
|
27
|
+
## Running the test suite
|
30
28
|
|
31
|
-
|
29
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
30
|
+
You can install it by opening a terminal window and running the
|
31
|
+
following command:
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
```sh
|
34
|
+
npm install -g jasmine
|
35
|
+
```
|
35
36
|
|
36
|
-
|
37
|
+
Run the test suite from the exercise directory with:
|
37
38
|
|
38
|
-
|
39
|
+
```sh
|
40
|
+
jasmine perfect-numbers.spec.js
|
41
|
+
```
|
39
42
|
|
40
|
-
|
41
|
-
changing `xit` to `it`.
|
43
|
+
In many test suites all but the first test have been marked "pending".
|
44
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
42
45
|
|
43
46
|
## Source
|
44
47
|
|
@@ -6,14 +6,15 @@ The **North American Numbering Plan (NANP)** is a telephone numbering system use
|
|
6
6
|
|
7
7
|
NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number. The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*.
|
8
8
|
|
9
|
-
|
10
9
|
The format is usually represented as
|
11
|
-
|
10
|
+
|
11
|
+
```text
|
12
12
|
(NXX)-NXX-XXXX
|
13
13
|
```
|
14
|
+
|
14
15
|
where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
|
15
16
|
|
16
|
-
Your task is to clean up differently
|
17
|
+
Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code (1) if present.
|
17
18
|
|
18
19
|
For example, the inputs
|
19
20
|
- `+1 (613)-995-0253`
|
@@ -29,26 +30,29 @@ should all produce the output
|
|
29
30
|
|
30
31
|
## Setup
|
31
32
|
|
32
|
-
Go through the setup instructions for JavaScript to
|
33
|
-
|
33
|
+
Go through the setup instructions for JavaScript to install the
|
34
|
+
necessary dependencies:
|
34
35
|
|
35
36
|
http://exercism.io/languages/javascript/installation
|
36
37
|
|
37
|
-
##
|
38
|
+
## Running the test suite
|
38
39
|
|
39
|
-
|
40
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
41
|
+
You can install it by opening a terminal window and running the
|
42
|
+
following command:
|
40
43
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
test the Hello World exercise:
|
44
|
+
```sh
|
45
|
+
npm install -g jasmine
|
46
|
+
```
|
45
47
|
|
46
|
-
|
48
|
+
Run the test suite from the exercise directory with:
|
47
49
|
|
48
|
-
|
50
|
+
```sh
|
51
|
+
jasmine phone-number.spec.js
|
52
|
+
```
|
49
53
|
|
50
|
-
|
51
|
-
changing `xit` to `it`.
|
54
|
+
In many test suites all but the first test have been marked "pending".
|
55
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
52
56
|
|
53
57
|
## Source
|
54
58
|
|
@@ -19,26 +19,29 @@ See <http://en.wikipedia.org/wiki/Pig_latin> for more details.
|
|
19
19
|
|
20
20
|
## Setup
|
21
21
|
|
22
|
-
Go through the setup instructions for JavaScript to
|
23
|
-
|
22
|
+
Go through the setup instructions for JavaScript to install the
|
23
|
+
necessary dependencies:
|
24
24
|
|
25
25
|
http://exercism.io/languages/javascript/installation
|
26
26
|
|
27
|
-
##
|
27
|
+
## Running the test suite
|
28
28
|
|
29
|
-
|
29
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
30
|
+
You can install it by opening a terminal window and running the
|
31
|
+
following command:
|
30
32
|
|
31
|
-
|
33
|
+
```sh
|
34
|
+
npm install -g jasmine
|
35
|
+
```
|
32
36
|
|
33
|
-
|
34
|
-
test the Hello World exercise:
|
37
|
+
Run the test suite from the exercise directory with:
|
35
38
|
|
36
|
-
|
39
|
+
```sh
|
40
|
+
jasmine pig-latin.spec.js
|
41
|
+
```
|
37
42
|
|
38
|
-
In many test suites all but the first test have been
|
39
|
-
|
40
|
-
Once you get a test passing, you can unskip the next one by
|
41
|
-
changing `xit` to `it`.
|
43
|
+
In many test suites all but the first test have been marked "pending".
|
44
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
42
45
|
|
43
46
|
## Source
|
44
47
|
|
@@ -36,26 +36,29 @@ distance function.
|
|
36
36
|
|
37
37
|
## Setup
|
38
38
|
|
39
|
-
Go through the setup instructions for JavaScript to
|
40
|
-
|
39
|
+
Go through the setup instructions for JavaScript to install the
|
40
|
+
necessary dependencies:
|
41
41
|
|
42
42
|
http://exercism.io/languages/javascript/installation
|
43
43
|
|
44
|
-
##
|
44
|
+
## Running the test suite
|
45
45
|
|
46
|
-
|
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:
|
47
49
|
|
48
|
-
|
50
|
+
```sh
|
51
|
+
npm install -g jasmine
|
52
|
+
```
|
49
53
|
|
50
|
-
|
51
|
-
test the Hello World exercise:
|
54
|
+
Run the test suite from the exercise directory with:
|
52
55
|
|
53
|
-
|
56
|
+
```sh
|
57
|
+
jasmine point-mutations.spec.js
|
58
|
+
```
|
54
59
|
|
55
|
-
In many test suites all but the first test have been
|
56
|
-
|
57
|
-
Once you get a test passing, you can unskip the next one by
|
58
|
-
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`.
|
59
62
|
|
60
63
|
## Source
|
61
64
|
|