trackler 2.2.1.86 → 2.2.1.87
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/reverse-string/metadata.yml +0 -1
- data/tracks/bash/CONTRIBUTING.md +129 -28
- data/tracks/bash/config/exercise_readme.go.tmpl +10 -4
- data/tracks/bash/exercises/acronym/README.md +8 -11
- data/tracks/bash/exercises/acronym/{acronym_tests.sh → acronym_test.sh} +0 -0
- data/tracks/bash/exercises/anagram/README.md +6 -1
- data/tracks/bash/exercises/anagram/anagram_test.sh +1 -1
- data/tracks/bash/exercises/armstrong-numbers/README.md +10 -2
- data/tracks/bash/exercises/atbash-cipher/README.md +6 -6
- data/tracks/bash/exercises/bob/README.md +8 -1
- data/tracks/bash/exercises/collatz-conjecture/README.md +11 -2
- data/tracks/bash/exercises/collatz-conjecture/{collatz_test.sh → collatz_conjecture_test.sh} +6 -6
- data/tracks/bash/exercises/difference-of-squares/README.md +6 -1
- data/tracks/bash/exercises/error-handling/README.md +13 -5
- data/tracks/bash/exercises/error-handling/error_handling_test.sh +18 -22
- data/tracks/bash/exercises/error-handling/example.sh +7 -6
- data/tracks/bash/exercises/gigasecond/.meta/hints.md +0 -5
- data/tracks/bash/exercises/gigasecond/README.md +36 -1
- data/tracks/bash/exercises/grains/README.md +10 -2
- data/tracks/bash/exercises/hamming/README.md +6 -1
- data/tracks/bash/exercises/hello-world/README.md +7 -2
- data/tracks/bash/exercises/leap/README.md +7 -2
- data/tracks/bash/exercises/luhn/README.md +7 -2
- data/tracks/bash/exercises/nucleotide-count/README.md +13 -22
- data/tracks/bash/exercises/pangram/README.md +7 -2
- data/tracks/bash/exercises/phone-number/README.md +10 -4
- data/tracks/bash/exercises/raindrops/README.md +6 -1
- data/tracks/bash/exercises/reverse-string/README.md +11 -2
- data/tracks/bash/exercises/rna-transcription/README.md +7 -2
- data/tracks/bash/exercises/roman-numerals/README.md +11 -2
- data/tracks/bash/exercises/triangle/README.md +5 -4
- data/tracks/bash/exercises/two-fer/README.md +7 -9
- data/tracks/bash/exercises/word-count/README.md +6 -2
- data/tracks/bash/exercises/word-count/example.sh +22 -13
- data/tracks/bash/scripts/canonical_data_check.sh +112 -0
- data/tracks/c/exercises/acronym/src/{example.h → acronym.h} +0 -0
- data/tracks/c/exercises/gigasecond/.meta/hints.md +124 -0
- data/tracks/c/exercises/gigasecond/README.md +126 -0
- data/tracks/c/exercises/isogram/src/{example.h → isogram.h} +0 -0
- data/tracks/c/exercises/meetup/.meta/hints.md +124 -0
- data/tracks/c/exercises/meetup/README.md +142 -12
- data/tracks/c/exercises/pangram/src/{example.h → pangram.h} +0 -0
- data/tracks/c/exercises/space-age/.meta/hints.md +124 -0
- data/tracks/c/exercises/space-age/README.md +127 -2
- data/tracks/elisp/bin/test-examples +11 -14
- data/tracks/elisp/config.json +9 -1
- data/tracks/elisp/exercises/acronym/README.md +13 -0
- data/tracks/elisp/exercises/acronym/acronym-test.el +28 -0
- data/tracks/elisp/exercises/acronym/acronym.el +11 -0
- data/tracks/elisp/exercises/acronym/example.el +14 -0
- data/tracks/elisp/exercises/bob/example.el +1 -3
- data/tracks/elisp/exercises/hamming/README.md +2 -0
- data/tracks/elisp/exercises/hamming/hamming-test.el +35 -12
- data/tracks/elisp/exercises/hamming/hamming.el +0 -3
- data/tracks/fsharp/exercises/custom-set/CustomSetTest.fs +206 -132
- data/tracks/fsharp/exercises/custom-set/Example.fs +2 -0
- data/tracks/fsharp/generators/Generators.fs +61 -0
- data/tracks/go/config.json +25 -2
- data/tracks/go/exercises/acronym/acronym_test.go +8 -0
- data/tracks/go/exercises/alphametics/.meta/gen.go +72 -0
- data/tracks/go/exercises/alphametics/.meta/hints.md +38 -0
- data/tracks/go/exercises/alphametics/README.md +93 -0
- data/tracks/go/exercises/alphametics/alphametics_test.go +33 -0
- data/tracks/go/exercises/alphametics/cases_test.go +59 -0
- data/tracks/go/exercises/alphametics/example.go +212 -0
- data/tracks/go/exercises/atbash-cipher/.meta/gen.go +6 -4
- data/tracks/go/exercises/atbash-cipher/cases_test.go +2 -2
- data/tracks/go/exercises/change/.meta/gen.go +7 -5
- data/tracks/go/exercises/change/cases_test.go +2 -2
- data/tracks/go/exercises/collatz-conjecture/.meta/gen.go +5 -3
- data/tracks/go/exercises/collatz-conjecture/cases_test.go +2 -2
- data/tracks/go/exercises/connect/.meta/gen.go +5 -3
- data/tracks/go/exercises/connect/cases_test.go +2 -2
- data/tracks/go/exercises/flatten-array/.meta/gen.go +5 -3
- data/tracks/go/exercises/flatten-array/cases_test.go +2 -2
- data/tracks/go/exercises/meetup/.meta/gen.go +19 -8
- data/tracks/go/exercises/meetup/cases_test.go +2 -2
- data/tracks/go/exercises/simple-linked-list/README.md +47 -0
- data/tracks/go/exercises/simple-linked-list/example.go +74 -0
- data/tracks/go/exercises/simple-linked-list/linked_list_test.go +210 -0
- data/tracks/idris/config.json +2 -2
- data/tracks/java/exercises/all-your-base/.meta/src/reference/java/BaseConverter.java +1 -5
- data/tracks/java/exercises/all-your-base/.meta/version +1 -1
- data/tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java +34 -10
- data/tracks/java/exercises/bob/README.md +2 -0
- data/tracks/java/exercises/kindergarten-garden/.meta/version +1 -0
- data/tracks/java/exercises/kindergarten-garden/src/test/java/KindergartenGardenTest.java +0 -55
- data/tracks/java/exercises/meetup/.meta/version +1 -0
- data/tracks/java/exercises/meetup/src/test/java/MeetupTest.java +32 -0
- data/tracks/java/exercises/parallel-letter-frequency/README.md +1 -0
- data/tracks/java/exercises/proverb/README.md +16 -10
- data/tracks/java/exercises/rail-fence-cipher/README.md +5 -6
- data/tracks/java/exercises/two-fer/README.md +1 -1
- data/tracks/java/exercises/word-search/.meta/version +1 -1
- data/tracks/java/exercises/word-search/src/test/java/WordSearcherTest.java +240 -2
- data/tracks/javascript/.eslintignore +0 -1
- data/tracks/javascript/exercises/palindrome-products/example.js +3 -3
- data/tracks/kotlin/docs/INSTALLATION.md +77 -68
- data/tracks/kotlin/docs/TESTS.md +41 -39
- data/tracks/perl6/exercises/acronym/acronym.t +20 -8
- data/tracks/perl6/exercises/acronym/example.yaml +1 -1
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +108 -66
- data/tracks/perl6/exercises/all-your-base/example.yaml +2 -2
- data/tracks/perl6/exercises/allergies/allergies.t +39 -15
- data/tracks/perl6/exercises/allergies/example.yaml +2 -2
- data/tracks/perl6/exercises/anagram/anagram.t +73 -40
- data/tracks/perl6/exercises/anagram/example.yaml +1 -1
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +38 -15
- data/tracks/perl6/exercises/atbash-cipher/example.yaml +1 -1
- data/tracks/perl6/exercises/bob/bob.t +77 -27
- data/tracks/perl6/exercises/bob/example.yaml +1 -1
- data/tracks/perl6/exercises/flatten-array/example.yaml +1 -1
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +20 -8
- data/tracks/perl6/exercises/luhn/example.yaml +1 -1
- data/tracks/perl6/exercises/luhn/luhn.t +42 -16
- data/tracks/perl6/exercises/roman-numerals/README.md +68 -0
- data/tracks/php/exercises/gigasecond/gigasecond_test.php +1 -1
- data/tracks/python/docs/ABOUT.md +2 -2
- metadata +27 -10
- data/tracks/bash/docs/EXERCISE_README_INSERT.md +0 -3
- data/tracks/bash/exercises/word-count/example.awk +0 -12
- data/tracks/java/exercises/alphametics/src/main/java/.keep +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
# Collatz Conjecture
|
1
|
+
# Collatz Conjecture
|
2
2
|
|
3
3
|
The Collatz Conjecture or 3x+1 problem can be summarized as follows:
|
4
4
|
|
@@ -26,9 +26,18 @@ Starting with n = 12, the steps would be as follows:
|
|
26
26
|
|
27
27
|
Resulting in 9 steps. So for input n = 12, the return value would be 9.
|
28
28
|
|
29
|
+
|
30
|
+
Run the tests with:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
bats collatz_conjecture_test.sh
|
34
|
+
```
|
35
|
+
|
36
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
37
|
+
|
29
38
|
## Source
|
30
39
|
|
31
|
-
An unsolved problem in mathematics named after mathematician Lothar Collatz [
|
40
|
+
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)
|
32
41
|
|
33
42
|
## Submitting Incomplete Solutions
|
34
43
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
data/tracks/bash/exercises/collatz-conjecture/{collatz_test.sh → collatz_conjecture_test.sh}
RENAMED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
@test "zero steps for one" {
|
4
4
|
#skip
|
5
|
-
run bash
|
5
|
+
run bash collatz_conjecture.sh 1
|
6
6
|
|
7
7
|
[ "$status" -eq 0 ]
|
8
8
|
[ "$output" -eq 0 ]
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
@test "divide if even" {
|
12
12
|
skip
|
13
|
-
run bash
|
13
|
+
run bash collatz_conjecture.sh 16
|
14
14
|
|
15
15
|
[ "$status" -eq 0 ]
|
16
16
|
[ "$output" -eq 4 ]
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
@test "even and odd steps" {
|
20
20
|
skip
|
21
|
-
run bash
|
21
|
+
run bash collatz_conjecture.sh 12
|
22
22
|
|
23
23
|
[ "$status" -eq 0 ]
|
24
24
|
[ "$output" -eq 9 ]
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
@test "large number of even and odd steps" {
|
28
28
|
skip
|
29
|
-
run bash
|
29
|
+
run bash collatz_conjecture.sh 1000000
|
30
30
|
|
31
31
|
[ "$status" -eq 0 ]
|
32
32
|
[ "$output" -eq 152 ]
|
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
@test "zero is an error" {
|
36
36
|
skip
|
37
|
-
run bash
|
37
|
+
run bash collatz_conjecture.sh 0
|
38
38
|
|
39
39
|
[ "$status" -eq 1 ]
|
40
40
|
[ "$output" == "Error: Only positive numbers are allowed" ]
|
@@ -42,7 +42,7 @@
|
|
42
42
|
|
43
43
|
@test "negative value is an error" {
|
44
44
|
skip
|
45
|
-
run bash
|
45
|
+
run bash collatz_conjecture.sh -15
|
46
46
|
|
47
47
|
[ "$status" -eq 1 ]
|
48
48
|
[ "$output" == "Error: Only positive numbers are allowed" ]
|
@@ -12,9 +12,14 @@ Hence the difference between the square of the sum of the first
|
|
12
12
|
ten natural numbers and the sum of the squares of the first ten
|
13
13
|
natural numbers is 3025 - 385 = 2640.
|
14
14
|
|
15
|
+
|
15
16
|
Run the tests with:
|
16
17
|
|
17
|
-
|
18
|
+
```bash
|
19
|
+
bats difference_of_squares_test.sh
|
20
|
+
```
|
21
|
+
|
22
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
18
23
|
|
19
24
|
## Source
|
20
25
|
|
@@ -1,15 +1,23 @@
|
|
1
|
-
# Error
|
1
|
+
# Error Handling
|
2
2
|
|
3
3
|
Implement various kinds of error handling and resource management.
|
4
4
|
|
5
|
-
An important point of programming is how to handle errors and close
|
5
|
+
An important point of programming is how to handle errors and close
|
6
|
+
resources even if errors occur.
|
7
|
+
|
8
|
+
This exercise requires you to handle various errors. Because error handling
|
9
|
+
is rather programming language specific you'll have to refer to the tests
|
10
|
+
for your track to see what's exactly required.
|
6
11
|
|
7
|
-
This exercise requires you to handle various errors. Because error handling is rather programming language specific you'll have to refer to the tests for your track to see what's exactly required.
|
8
12
|
|
9
13
|
Run the tests with:
|
10
14
|
|
11
|
-
|
15
|
+
```bash
|
16
|
+
bats error_handling_test.sh
|
17
|
+
```
|
18
|
+
|
19
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
20
|
+
|
12
21
|
|
13
22
|
## Submitting Incomplete Solutions
|
14
23
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
15
|
-
|
@@ -1,36 +1,32 @@
|
|
1
1
|
#!/usr/bin/env bats
|
2
2
|
|
3
3
|
@test "correct arguments" {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
#skip
|
5
|
+
run bash error_handling.sh Alice
|
6
|
+
|
7
|
+
[ "$status" -eq 0 ]
|
8
|
+
[ "$output" = "Hello, Alice" ]
|
9
9
|
}
|
10
10
|
|
11
11
|
@test "one long argument" {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
skip
|
13
|
+
run bash error_handling.sh "Alice and Bob"
|
14
|
+
|
15
|
+
[ "$status" -eq 0 ]
|
16
|
+
[ "$output" = "Hello, Alice and Bob" ]
|
17
17
|
}
|
18
18
|
|
19
19
|
@test "incorrect arguments" {
|
20
|
-
|
21
|
-
|
20
|
+
skip
|
21
|
+
run bash error_handling.sh Alice Bob
|
22
22
|
|
23
|
-
|
23
|
+
[ "$status" -ne 0 ]
|
24
24
|
}
|
25
25
|
|
26
|
-
@test "
|
27
|
-
|
28
|
-
|
29
|
-
[ echo $SHELLOPTS | grep -q 'errexit' ]
|
30
|
-
}
|
26
|
+
@test "print usage banner with no value given" {
|
27
|
+
skip
|
28
|
+
run bash error_handling.sh
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
source error_handling.sh
|
35
|
-
[ echo $SHELLOPTS | grep -q 'nounset' ]
|
30
|
+
[ "$status" -eq 1 ]
|
31
|
+
[ "$output" = "Usage: ./error_handling <greetee>" ]
|
36
32
|
}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
set -
|
3
|
+
set -o errexit
|
4
|
+
set -o nounset
|
4
5
|
|
5
|
-
if
|
6
|
-
|
7
|
-
|
8
|
-
exit 1
|
6
|
+
if [ $# -ne 1 ]; then
|
7
|
+
echo "Usage: ./error_handling <greetee>"
|
8
|
+
exit 1
|
9
9
|
else
|
10
|
-
|
10
|
+
echo "Hello, ${1}"
|
11
|
+
exit 0
|
11
12
|
fi
|
@@ -4,9 +4,44 @@ Calculate the moment when someone has lived for 10^9 seconds.
|
|
4
4
|
|
5
5
|
A gigasecond is 10^9 (1,000,000,000) seconds.
|
6
6
|
|
7
|
+
## Test-Driven Development
|
8
|
+
|
9
|
+
As programmers mature, they eventually want to test their code.
|
10
|
+
|
11
|
+
Here at Exercism we simulate [Test-Driven
|
12
|
+
Development](http://en.wikipedia.org/wiki/Test-driven_development) (TDD), where
|
13
|
+
you write your tests before writing any functionality. The simulation comes in
|
14
|
+
the form of a pre-written test suite, which will signal that you have solved
|
15
|
+
the problem.
|
16
|
+
|
17
|
+
It will also provide you with a safety net to explore other solutions without
|
18
|
+
breaking the functionality.
|
19
|
+
|
20
|
+
### A typical TDD workflow on Exercism:
|
21
|
+
|
22
|
+
1. Run the test file and pick one test that's failing.
|
23
|
+
2. Write some code to fix the test you picked.
|
24
|
+
3. Re-run the tests to confirm the test is now passing.
|
25
|
+
4. Repeat from step 1.
|
26
|
+
5. Submit your solution (`exercism submit /path/to/file`)
|
27
|
+
|
28
|
+
## Instructions
|
29
|
+
|
30
|
+
Submissions are encouraged to be general, within reason. Having said that, it's
|
31
|
+
also important not to over-engineer a solution.
|
32
|
+
|
33
|
+
It's important to remember that the goal is to make code as expressive and
|
34
|
+
readable as we can.
|
35
|
+
|
36
|
+
|
37
|
+
|
7
38
|
Run the tests with:
|
8
39
|
|
9
|
-
|
40
|
+
```bash
|
41
|
+
bats gigasecond_test.sh
|
42
|
+
```
|
43
|
+
|
44
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
10
45
|
|
11
46
|
## Source
|
12
47
|
|
@@ -26,10 +26,18 @@ are some additional things you could try:
|
|
26
26
|
Then please share your thoughts in a comment on the submission. Did this
|
27
27
|
experiment make the code better? Worse? Did you learn anything from it?
|
28
28
|
|
29
|
+
|
30
|
+
Run the tests with:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
bats grains_test.sh
|
34
|
+
```
|
35
|
+
|
36
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
37
|
+
|
29
38
|
## Source
|
30
39
|
|
31
|
-
|
40
|
+
JavaRanch Cattle Drive, exercise 6 [http://www.javaranch.com/grains.jsp](http://www.javaranch.com/grains.jsp)
|
32
41
|
|
33
42
|
## Submitting Incomplete Solutions
|
34
|
-
|
35
43
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -35,9 +35,14 @@ The Hamming distance is only defined for sequences of equal length. This means
|
|
35
35
|
that based on the definition, each language could deal with getting sequences
|
36
36
|
of equal length differently.
|
37
37
|
|
38
|
+
|
38
39
|
Run the tests with:
|
39
40
|
|
40
|
-
|
41
|
+
```bash
|
42
|
+
bats hamming_test.sh
|
43
|
+
```
|
44
|
+
|
45
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
41
46
|
|
42
47
|
## Source
|
43
48
|
|
@@ -29,7 +29,7 @@ can get the tests to pass on your machine, we are doing great.
|
|
29
29
|
|
30
30
|
## Installation
|
31
31
|
|
32
|
-
As
|
32
|
+
As mentioned above, if you are on a unix-like OS (Mac OS X, Linux, Solaris,
|
33
33
|
etc), you probably already have bash.
|
34
34
|
|
35
35
|
## Testing
|
@@ -54,9 +54,14 @@ seconds
|
|
54
54
|
```
|
55
55
|
|
56
56
|
|
57
|
+
|
57
58
|
Run the tests with:
|
58
59
|
|
59
|
-
|
60
|
+
```bash
|
61
|
+
bats hello_world_test.sh
|
62
|
+
```
|
63
|
+
|
64
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
60
65
|
|
61
66
|
## Source
|
62
67
|
|
@@ -4,7 +4,7 @@ Given a year, report if it is a leap year.
|
|
4
4
|
|
5
5
|
The tricky thing here is that a leap year in the Gregorian calendar occurs:
|
6
6
|
|
7
|
-
```
|
7
|
+
```text
|
8
8
|
on every year that is evenly divisible by 4
|
9
9
|
except every year that is evenly divisible by 100
|
10
10
|
unless the year is also evenly divisible by 400
|
@@ -26,9 +26,14 @@ phenomenon, go watch [this youtube video][video].
|
|
26
26
|
|
27
27
|
[video]: http://www.youtube.com/watch?v=xX96xng7sAE
|
28
28
|
|
29
|
+
|
29
30
|
Run the tests with:
|
30
31
|
|
31
|
-
|
32
|
+
```bash
|
33
|
+
bats leap_test.sh
|
34
|
+
```
|
35
|
+
|
36
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
32
37
|
|
33
38
|
## Source
|
34
39
|
|
@@ -64,13 +64,18 @@ Sum the digits
|
|
64
64
|
|
65
65
|
57 is not evenly divisible by 10, so this number is not valid.
|
66
66
|
|
67
|
+
|
67
68
|
Run the tests with:
|
68
69
|
|
69
|
-
|
70
|
+
```bash
|
71
|
+
bats luhn_test.sh
|
72
|
+
```
|
73
|
+
|
74
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
70
75
|
|
71
76
|
## Source
|
72
77
|
|
73
|
-
The Luhn Algorithm on Wikipedia [
|
78
|
+
The Luhn Algorithm on Wikipedia [http://en.wikipedia.org/wiki/Luhn_algorithm](http://en.wikipedia.org/wiki/Luhn_algorithm)
|
74
79
|
|
75
80
|
## Submitting Incomplete Solutions
|
76
81
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -1,34 +1,25 @@
|
|
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.
|
11
|
+
- nucleotides are to DNA as
|
12
|
+
- legos are to lego houses as
|
13
|
+
- words are to sentences as...
|
20
14
|
|
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
15
|
|
29
16
|
Run the tests with:
|
30
17
|
|
31
|
-
|
18
|
+
```bash
|
19
|
+
bats nucleotide_count_test.sh
|
20
|
+
```
|
21
|
+
|
22
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
32
23
|
|
33
24
|
## Source
|
34
25
|
|
@@ -2,15 +2,20 @@
|
|
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
|
9
9
|
insensitive. Input will not contain non-ASCII symbols.
|
10
10
|
|
11
|
+
|
11
12
|
Run the tests with:
|
12
13
|
|
13
|
-
|
14
|
+
```bash
|
15
|
+
bats pangram_test.sh
|
16
|
+
```
|
17
|
+
|
18
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
14
19
|
|
15
20
|
## Source
|
16
21
|
|
@@ -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`
|
@@ -27,9 +28,14 @@ should all produce the output
|
|
27
28
|
|
28
29
|
**Note:** As this exercise only deals with telephone numbers used in NANP-countries, only 1 is considered a valid country code.
|
29
30
|
|
31
|
+
|
30
32
|
Run the tests with:
|
31
33
|
|
32
|
-
|
34
|
+
```bash
|
35
|
+
bats phone_number_test.sh
|
36
|
+
```
|
37
|
+
|
38
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
33
39
|
|
34
40
|
## Source
|
35
41
|
|