trackler 2.2.1.49 → 2.2.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/verify-configs +1 -1
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/kindergarten-garden/canonical-data.json +0 -37
- data/tracks/c/exercises/allergies/test/test_allergies.c +41 -41
- data/tracks/common-lisp/config.json +266 -252
- data/tracks/common-lisp/config/maintainers.json +23 -23
- data/tracks/common-lisp/exercises/allergies/README.md +0 -1
- data/tracks/common-lisp/exercises/atbash-cipher/README.md +2 -1
- data/tracks/common-lisp/exercises/beer-song/README.md +1 -1
- data/tracks/common-lisp/exercises/binary/README.md +2 -0
- data/tracks/common-lisp/exercises/collatz-conjecture/README.md +4 -8
- data/tracks/common-lisp/exercises/crypto-square/README.md +4 -4
- data/tracks/common-lisp/exercises/etl/README.md +2 -0
- data/tracks/common-lisp/exercises/grade-school/README.md +0 -1
- data/tracks/common-lisp/exercises/grains/README.md +0 -1
- data/tracks/common-lisp/exercises/leap/README.md +1 -1
- data/tracks/common-lisp/exercises/meetup/README.md +1 -2
- data/tracks/common-lisp/exercises/nucleotide-count/README.md +8 -22
- data/tracks/common-lisp/exercises/pascals-triangle/README.md +1 -1
- data/tracks/common-lisp/exercises/perfect-numbers/README.md +3 -4
- data/tracks/common-lisp/exercises/phone-number/README.md +3 -2
- data/tracks/common-lisp/exercises/roman-numerals/README.md +1 -1
- data/tracks/common-lisp/exercises/scrabble-score/README.md +3 -1
- data/tracks/common-lisp/exercises/space-age/README.md +2 -1
- data/tracks/common-lisp/exercises/sublist/README.md +65 -0
- data/tracks/common-lisp/exercises/sublist/example.lisp +24 -0
- data/tracks/common-lisp/exercises/sublist/sublist-test.lisp +87 -0
- data/tracks/common-lisp/exercises/sublist/sublist.lisp +8 -0
- data/tracks/common-lisp/exercises/triangle/README.md +9 -6
- data/tracks/common-lisp/exercises/trinary/README.md +1 -1
- data/tracks/common-lisp/exercises/word-count/README.md +1 -2
- data/tracks/ecmascript/config.json +30 -0
- data/tracks/ecmascript/exercises/bowling/README.md +80 -0
- data/tracks/ecmascript/exercises/bowling/bowling.spec.js +159 -0
- data/tracks/ecmascript/exercises/bowling/example.js +67 -0
- data/tracks/ecmascript/exercises/bowling/package.json +71 -0
- data/tracks/ecmascript/exercises/two-fer/README.md +47 -0
- data/tracks/ecmascript/exercises/two-fer/example.js +4 -0
- data/tracks/ecmascript/exercises/two-fer/package.json +69 -0
- data/tracks/ecmascript/exercises/two-fer/two-fer.spec.js +18 -0
- data/tracks/fsharp/exercises/pascals-triangle/Example.fs +12 -8
- data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangle.fs +2 -2
- data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangleTest.fs +15 -12
- data/tracks/fsharp/generators/Generators.fs +19 -0
- data/tracks/fsharp/generators/Templates/_AssertThrows.liquid +1 -0
- data/tracks/java/docs/ABOUT.md +13 -31
- data/tracks/java/exercises/bracket-push/.meta/version +1 -1
- data/tracks/java/exercises/bracket-push/src/test/java/BracketCheckerTest.java +7 -1
- data/tracks/java/exercises/collatz-conjecture/.meta/version +1 -1
- data/tracks/java/exercises/etl/README.md +1 -1
- data/tracks/java/exercises/ocr-numbers/README.md +1 -1
- data/tracks/java/exercises/pascals-triangle/README.md +1 -1
- data/tracks/java/exercises/perfect-numbers/.meta/version +1 -1
- data/tracks/java/exercises/rna-transcription/README.md +1 -1
- data/tracks/java/exercises/secret-handshake/.meta/version +1 -1
- data/tracks/java/exercises/secret-handshake/src/test/java/HandshakeCalculatorTest.java +1 -9
- data/tracks/java/scripts/canonical_data_check.sh +104 -0
- data/tracks/javascript/exercises/twelve-days/example.js +23 -25
- data/tracks/julia/.travis.yml +1 -0
- data/tracks/kotlin/exercises/all-your-base/.meta/version +1 -0
- data/tracks/kotlin/exercises/all-your-base/src/test/kotlin/BaseConverterTest.kt +0 -3
- data/tracks/kotlin/exercises/change/.meta/version +1 -0
- data/tracks/kotlin/exercises/change/src/test/kotlin/ChangeCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/clock/.meta/version +1 -0
- data/tracks/kotlin/exercises/clock/src/test/kotlin/ClockAddTest.kt +1 -4
- data/tracks/kotlin/exercises/clock/src/test/kotlin/ClockCreationTest.kt +1 -4
- data/tracks/kotlin/exercises/clock/src/test/kotlin/ClockEqualTest.kt +1 -4
- data/tracks/kotlin/exercises/collatz-conjecture/.meta/version +1 -0
- data/tracks/kotlin/exercises/collatz-conjecture/src/test/kotlin/CollatzCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/complex-numbers/.meta/version +1 -0
- data/tracks/kotlin/exercises/complex-numbers/src/test/kotlin/ComplexNumberTest.kt +0 -3
- data/tracks/kotlin/exercises/diamond/.meta/version +1 -0
- data/tracks/kotlin/exercises/diamond/src/test/kotlin/DiamondPrinterTest.kt +0 -3
- data/tracks/kotlin/exercises/etl/README.md +1 -1
- data/tracks/kotlin/exercises/forth/.meta/version +1 -0
- data/tracks/kotlin/exercises/forth/src/test/kotlin/ForthEvaluatorTest.kt +0 -3
- data/tracks/kotlin/exercises/grains/.meta/version +1 -0
- data/tracks/kotlin/exercises/grains/src/test/kotlin/BoardTest.kt +0 -3
- data/tracks/kotlin/exercises/hamming/.meta/version +1 -0
- data/tracks/kotlin/exercises/hamming/src/test/kotlin/HammingTest.kt +0 -3
- data/tracks/kotlin/exercises/list-ops/.meta/version +1 -0
- data/tracks/kotlin/exercises/list-ops/src/test/kotlin/ListExtensionsTest.kt +0 -3
- data/tracks/kotlin/exercises/meetup/.meta/version +1 -0
- data/tracks/kotlin/exercises/meetup/src/test/kotlin/MeetupTest.kt +0 -3
- data/tracks/kotlin/exercises/minesweeper/.meta/version +1 -0
- data/tracks/kotlin/exercises/minesweeper/src/test/kotlin/MinesweeperBoardTest.kt +0 -3
- data/tracks/kotlin/exercises/pangram/.meta/version +1 -0
- data/tracks/kotlin/exercises/pangram/src/test/kotlin/PangramTest.kt +0 -3
- data/tracks/kotlin/exercises/pascals-triangle/README.md +1 -1
- data/tracks/kotlin/exercises/prime-factors/.meta/version +1 -0
- data/tracks/kotlin/exercises/prime-factors/src/test/kotlin/PrimeFactorCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/rna-transcription/.meta/version +1 -0
- data/tracks/kotlin/exercises/rna-transcription/README.md +1 -1
- data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +0 -3
- data/tracks/kotlin/exercises/robot-simulator/.meta/version +1 -0
- data/tracks/kotlin/exercises/robot-simulator/src/test/kotlin/RobotTest.kt +0 -3
- data/tracks/kotlin/exercises/rotational-cipher/.meta/version +1 -0
- data/tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt +0 -3
- data/tracks/kotlin/exercises/saddle-points/.meta/version +1 -0
- data/tracks/kotlin/exercises/saddle-points/src/test/kotlin/MatrixTest.kt +0 -3
- data/tracks/kotlin/exercises/say/.meta/version +1 -0
- data/tracks/kotlin/exercises/say/src/test/kotlin/NumberSpellerTest.kt +0 -3
- data/tracks/kotlin/exercises/secret-handshake/.meta/version +1 -0
- data/tracks/kotlin/exercises/secret-handshake/src/test/kotlin/HandshakeCalculatorTest.kt +0 -3
- data/tracks/kotlin/exercises/spiral-matrix/.meta/version +1 -0
- data/tracks/kotlin/exercises/spiral-matrix/src/test/kotlin/SpiralMatrixTest.kt +0 -3
- data/tracks/kotlin/exercises/sublist/.meta/version +1 -0
- data/tracks/kotlin/exercises/sublist/src/test/kotlin/SublistTest.kt +0 -3
- data/tracks/kotlin/scripts/canonical_data_check.sh +104 -0
- data/tracks/perl6/exercises/accumulate/accumulate.t +2 -3
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +17 -18
- data/tracks/perl6/exercises/allergies/allergies.t +17 -18
- data/tracks/perl6/exercises/anagram/anagram.t +17 -18
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +17 -18
- data/tracks/perl6/exercises/bob/bob.t +20 -22
- data/tracks/perl6/exercises/bob/example.yaml +1 -2
- data/tracks/perl6/exercises/clock/clock.t +17 -18
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +17 -18
- data/tracks/perl6/exercises/grade-school/grade-school.t +2 -3
- data/tracks/perl6/exercises/grains/grains.t +17 -18
- data/tracks/perl6/exercises/hello-world/example.yaml +1 -2
- data/tracks/perl6/exercises/hello-world/hello-world.t +20 -22
- data/tracks/perl6/exercises/leap/leap.t +17 -18
- data/tracks/perl6/exercises/linked-list/linked-list.t +2 -3
- data/tracks/perl6/exercises/luhn/luhn.t +17 -18
- data/tracks/perl6/exercises/phone-number/phone-number.t +17 -18
- data/tracks/perl6/exercises/raindrops/raindrops.t +17 -18
- data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +17 -18
- data/tracks/perl6/exercises/robot-name/robot-name.t +2 -3
- data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +17 -18
- data/tracks/perl6/exercises/space-age/space-age.t +17 -18
- data/tracks/perl6/exercises/word-count/word-count.t +17 -18
- data/tracks/perl6/exercises/wordy/wordy.t +17 -18
- data/tracks/perl6/templates/test.mustache +9 -10
- data/tracks/purescript/config.json +11 -0
- data/tracks/purescript/exercises/rna-transcription/README.md +25 -0
- data/tracks/purescript/exercises/rna-transcription/bower.json +26 -0
- data/tracks/purescript/exercises/rna-transcription/examples/src/RNATranscription.purs +18 -0
- data/tracks/purescript/exercises/rna-transcription/src/RNATranscription.purs +3 -0
- data/tracks/purescript/exercises/rna-transcription/test/Main.purs +48 -0
- data/tracks/python/exercises/variable-length-quantity/example.py +6 -6
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity.py +2 -2
- data/tracks/ruby/config.json +6 -0
- data/tracks/ruby/exercises/complex-numbers/.meta/.version +1 -0
- data/tracks/ruby/exercises/complex-numbers/.meta/generator/complex_numbers_case.rb +44 -0
- data/tracks/ruby/exercises/complex-numbers/.meta/solutions/complex_numbers.rb +49 -0
- data/tracks/ruby/exercises/complex-numbers/README.md +64 -0
- data/tracks/ruby/exercises/complex-numbers/complex_numbers_test.rb +207 -0
- data/tracks/ruby/exercises/crypto-square/.meta/.version +1 -0
- data/tracks/ruby/exercises/crypto-square/.meta/generator/crypto_square_case.rb +19 -0
- data/tracks/ruby/exercises/crypto-square/.meta/solutions/crypto_square.rb +20 -15
- data/tracks/ruby/exercises/crypto-square/README.md +10 -8
- data/tracks/ruby/exercises/crypto-square/crypto_square_test.rb +45 -81
- data/tracks/ruby/exercises/flatten-array/.meta/.version +1 -0
- data/tracks/ruby/exercises/flatten-array/.meta/generator/flatten_array_case.rb +11 -0
- data/tracks/ruby/exercises/flatten-array/.meta/solutions/flatten_array.rb +5 -2
- data/tracks/ruby/exercises/flatten-array/flatten_array_test.rb +32 -7
- data/tracks/ruby/exercises/hamming/hamming_test.rb +3 -3
- data/tracks/ruby/exercises/isogram/isogram_test.rb +4 -4
- data/tracks/ruby/exercises/leap/leap_test.rb +2 -2
- data/tracks/ruby/exercises/pig-latin/.meta/.version +1 -1
- data/tracks/ruby/exercises/pig-latin/.meta/solutions/pig_latin.rb +2 -2
- data/tracks/ruby/exercises/pig-latin/pig_latin_test.rb +17 -7
- data/tracks/ruby/exercises/queen-attack/.meta/generator/queen_attack_case.rb +1 -1
- data/tracks/ruby/exercises/queen-attack/queen_attack_test.rb +7 -7
- data/tracks/ruby/exercises/sum-of-multiples/.meta/.version +1 -1
- data/tracks/ruby/exercises/sum-of-multiples/.meta/solutions/sum_of_multiples.rb +1 -1
- data/tracks/ruby/exercises/sum-of-multiples/sum_of_multiples_test.rb +7 -2
- metadata +53 -2
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
+
"docs_url": "https://github.com/exercism/docs/blob/master/maintaining-a-track/maintainer-configuration.md",
|
|
2
3
|
"maintainers": [
|
|
3
4
|
{
|
|
4
|
-
"github_username": "verdammelt",
|
|
5
|
-
"show_on_website": true,
|
|
6
5
|
"alumnus": false,
|
|
7
|
-
"
|
|
6
|
+
"avatar_url": null,
|
|
8
7
|
"bio": "I have always been interested in Lisps since taking the SICP course in college. I love the expressiveness and conciseness of the simple syntax, and the ability to build the language upward to meet the domain.",
|
|
8
|
+
"github_username": "verdammelt",
|
|
9
9
|
"link_text": "Code and Cocktails",
|
|
10
10
|
"link_url": "http://code-and-cocktails.herokuapp.com/",
|
|
11
|
-
"
|
|
11
|
+
"name": "Mark Simpson",
|
|
12
|
+
"show_on_website": true
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
|
-
"github_username": "oubiwann",
|
|
15
|
-
"show_on_website": false,
|
|
16
15
|
"alumnus": false,
|
|
17
|
-
"
|
|
16
|
+
"avatar_url": null,
|
|
18
17
|
"bio": null,
|
|
18
|
+
"github_username": "oubiwann",
|
|
19
19
|
"link_text": null,
|
|
20
20
|
"link_url": null,
|
|
21
|
-
"
|
|
21
|
+
"name": null,
|
|
22
|
+
"show_on_website": false
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
|
-
"github_username": "arguello",
|
|
25
|
-
"show_on_website": false,
|
|
26
25
|
"alumnus": false,
|
|
27
|
-
"
|
|
26
|
+
"avatar_url": null,
|
|
28
27
|
"bio": null,
|
|
28
|
+
"github_username": "arguello",
|
|
29
29
|
"link_text": null,
|
|
30
30
|
"link_url": null,
|
|
31
|
-
"
|
|
31
|
+
"name": null,
|
|
32
|
+
"show_on_website": false
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
|
-
"github_username": "yurrriq",
|
|
35
|
-
"show_on_website": false,
|
|
36
35
|
"alumnus": false,
|
|
37
|
-
"
|
|
36
|
+
"avatar_url": null,
|
|
38
37
|
"bio": null,
|
|
38
|
+
"github_username": "yurrriq",
|
|
39
39
|
"link_text": null,
|
|
40
40
|
"link_url": null,
|
|
41
|
-
"
|
|
41
|
+
"name": null,
|
|
42
|
+
"show_on_website": false
|
|
42
43
|
},
|
|
43
44
|
{
|
|
44
|
-
"github_username": "wobh",
|
|
45
|
-
"show_on_website": false,
|
|
46
45
|
"alumnus": false,
|
|
47
|
-
"
|
|
46
|
+
"avatar_url": null,
|
|
48
47
|
"bio": null,
|
|
48
|
+
"github_username": "wobh",
|
|
49
49
|
"link_text": null,
|
|
50
50
|
"link_url": null,
|
|
51
|
-
"
|
|
51
|
+
"name": null,
|
|
52
|
+
"show_on_website": false
|
|
52
53
|
}
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
@@ -29,7 +29,6 @@ allergens that score 256, 512, 1024, etc.). Your program should
|
|
|
29
29
|
ignore those components of the score. For example, if the allergy
|
|
30
30
|
score is 257, your program should only report the eggs (1) allergy.
|
|
31
31
|
|
|
32
|
-
|
|
33
32
|
## Setup
|
|
34
33
|
|
|
35
34
|
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
|
@@ -9,7 +9,7 @@ letter, the second with the second-last, and so on.
|
|
|
9
9
|
|
|
10
10
|
An Atbash cipher for the Latin alphabet would be as follows:
|
|
11
11
|
|
|
12
|
-
```
|
|
12
|
+
```text
|
|
13
13
|
Plain: abcdefghijklmnopqrstuvwxyz
|
|
14
14
|
Cipher: zyxwvutsrqponmlkjihgfedcba
|
|
15
15
|
```
|
|
@@ -23,6 +23,7 @@ being 5 letters, and punctuation is excluded. This is to make it harder to guess
|
|
|
23
23
|
things based on word boundaries.
|
|
24
24
|
|
|
25
25
|
## Examples
|
|
26
|
+
|
|
26
27
|
- Encoding `test` gives `gvhg`
|
|
27
28
|
- Decoding `gvhg` gives `test`
|
|
28
29
|
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`
|
|
@@ -4,7 +4,7 @@ Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles
|
|
|
4
4
|
|
|
5
5
|
Note that not all verses are identical.
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```text
|
|
8
8
|
99 bottles of beer on the wall, 99 bottles of beer.
|
|
9
9
|
Take one down and pass it around, 98 bottles of beer on the wall.
|
|
10
10
|
|
|
@@ -7,10 +7,12 @@ string, your program should produce a decimal output. The
|
|
|
7
7
|
program should handle invalid inputs.
|
|
8
8
|
|
|
9
9
|
## Note
|
|
10
|
+
|
|
10
11
|
- Implement the conversion yourself.
|
|
11
12
|
Do not use something else to perform the conversion for you.
|
|
12
13
|
|
|
13
14
|
## About Binary (Base-2)
|
|
15
|
+
|
|
14
16
|
Decimal is a base-10 system.
|
|
15
17
|
|
|
16
18
|
A number 23 in base 10 notation can be understood
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# Collatz Conjecture
|
|
2
2
|
|
|
3
3
|
The Collatz Conjecture or 3x+1 problem can be summarized as follows:
|
|
4
4
|
|
|
@@ -10,6 +10,7 @@ always reach 1 eventually.
|
|
|
10
10
|
Given a number n, return the number of steps required to reach 1.
|
|
11
11
|
|
|
12
12
|
## Examples
|
|
13
|
+
|
|
13
14
|
Starting with n = 12, the steps would be as follows:
|
|
14
15
|
|
|
15
16
|
0. 12
|
|
@@ -25,10 +26,6 @@ Starting with n = 12, the steps would be as follows:
|
|
|
25
26
|
|
|
26
27
|
Resulting in 9 steps. So for input n = 12, the return value would be 9.
|
|
27
28
|
|
|
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
|
-
|
|
32
29
|
## Setup
|
|
33
30
|
|
|
34
31
|
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
|
@@ -75,10 +72,9 @@ One suggested add-on for Emacs and Common Lisp is
|
|
|
75
72
|
[SLIME](https://github.com/slime/slime) which offers tight integration
|
|
76
73
|
with the REPL; making iterative coding and testing very easy.
|
|
77
74
|
|
|
78
|
-
|
|
79
75
|
## Source
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
|
|
77
|
+
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)
|
|
82
78
|
|
|
83
79
|
## Submitting Incomplete Solutions
|
|
84
80
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -26,7 +26,7 @@ and `r` is the number of rows.
|
|
|
26
26
|
Our normalized text is 54 characters long, dictating a rectangle with
|
|
27
27
|
`c = 8` and `r = 7`:
|
|
28
28
|
|
|
29
|
-
```
|
|
29
|
+
```text
|
|
30
30
|
ifmanwas
|
|
31
31
|
meanttos
|
|
32
32
|
tayonthe
|
|
@@ -41,7 +41,7 @@ right.
|
|
|
41
41
|
|
|
42
42
|
The message above is coded as:
|
|
43
43
|
|
|
44
|
-
```
|
|
44
|
+
```text
|
|
45
45
|
imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
|
|
46
46
|
```
|
|
47
47
|
|
|
@@ -49,14 +49,14 @@ Output the encoded text in chunks. Phrases that fill perfect squares
|
|
|
49
49
|
`(r X r)` should be output in `r`-length chunks separated by spaces.
|
|
50
50
|
Imperfect squares will have `n` empty spaces. Those spaces should be distributed evenly across the last `n` rows.
|
|
51
51
|
|
|
52
|
-
```
|
|
52
|
+
```text
|
|
53
53
|
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Notice that were we to stack these, we could visually decode the
|
|
57
57
|
cyphertext back in to the original message:
|
|
58
58
|
|
|
59
|
-
```
|
|
59
|
+
```text
|
|
60
60
|
imtgdvs
|
|
61
61
|
fearwer
|
|
62
62
|
mayoogo
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
We are going to do the `Transform` step of an Extract-Transform-Load.
|
|
4
4
|
|
|
5
5
|
### ETL
|
|
6
|
+
|
|
6
7
|
Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
|
|
7
8
|
we're going to migrate this."
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@ once." That's then typically followed by much forehead slapping and
|
|
|
11
12
|
moaning about how stupid we could possibly be.)
|
|
12
13
|
|
|
13
14
|
### The goal
|
|
15
|
+
|
|
14
16
|
We're going to extract some scrabble scores from a legacy system.
|
|
15
17
|
|
|
16
18
|
The old system stored a list of letters per score:
|
|
@@ -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
|
|
@@ -18,10 +18,9 @@ end in '-teenth'. Therefore, one is guaranteed that each day of the week
|
|
|
18
18
|
(Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
|
|
19
19
|
in every month.
|
|
20
20
|
|
|
21
|
-
Given examples of a meetup dates, each containing a month, day, year, and descriptor
|
|
21
|
+
Given examples of a meetup dates, each containing a month, day, year, and descriptor
|
|
22
22
|
(first, second, teenth, etc), calculate the date of the actual meetup.
|
|
23
23
|
For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
|
|
24
|
-
|
|
25
24
|
|
|
26
25
|
## Setup
|
|
27
26
|
|
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
# Nucleotide Count
|
|
2
2
|
|
|
3
|
-
Given a DNA string, compute how many times each nucleotide occurs in the string.
|
|
3
|
+
Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Perfect
|
|
1
|
+
# Perfect Numbers
|
|
2
2
|
|
|
3
3
|
Determine if a number is perfect, abundant, or deficient based on
|
|
4
4
|
Nicomachus' (60 - 120 CE) classification scheme for natural numbers.
|
|
@@ -63,10 +63,9 @@ One suggested add-on for Emacs and Common Lisp is
|
|
|
63
63
|
[SLIME](https://github.com/slime/slime) which offers tight integration
|
|
64
64
|
with the REPL; making iterative coding and testing very easy.
|
|
65
65
|
|
|
66
|
-
|
|
67
66
|
## Source
|
|
68
|
-
|
|
69
|
-
[http://shop.oreilly.com/product/0636920029687.do](http://shop.oreilly.com/product/0636920029687.do)
|
|
67
|
+
|
|
68
|
+
Taken from Chapter 2 of Functional Thinking by Neal Ford. [http://shop.oreilly.com/product/0636920029687.do](http://shop.oreilly.com/product/0636920029687.do)
|
|
70
69
|
|
|
71
70
|
## Submitting Incomplete Solutions
|
|
72
71
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -6,11 +6,12 @@ The **North American Numbering Plan (NANP)** is a telephone numbering system use
|
|
|
6
6
|
|
|
7
7
|
NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number. The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*.
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
The format is usually represented as
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
12
|
(NXX)-NXX-XXXX
|
|
13
13
|
```
|
|
14
|
+
|
|
14
15
|
where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
|
|
15
16
|
|
|
16
17
|
Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
|
|
@@ -6,7 +6,7 @@ Given a word, compute the scrabble score for that word.
|
|
|
6
6
|
|
|
7
7
|
You'll need these:
|
|
8
8
|
|
|
9
|
-
```
|
|
9
|
+
```text
|
|
10
10
|
Letter Value
|
|
11
11
|
A, E, I, O, U, L, N, R, S, T 1
|
|
12
12
|
D, G 2
|
|
@@ -18,6 +18,7 @@ Q, Z 10
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Examples
|
|
21
|
+
|
|
21
22
|
"cabbage" should be scored as worth 14 points:
|
|
22
23
|
|
|
23
24
|
- 3 points for C
|
|
@@ -34,6 +35,7 @@ And to total:
|
|
|
34
35
|
- = 14
|
|
35
36
|
|
|
36
37
|
## Extensions
|
|
38
|
+
|
|
37
39
|
- You can play a double or a triple letter.
|
|
38
40
|
- You can play a double or a triple word.
|
|
39
41
|
|
|
@@ -12,7 +12,8 @@ Given an age in seconds, calculate how old someone would be on:
|
|
|
12
12
|
- Neptune: orbital period 164.79132 Earth years
|
|
13
13
|
|
|
14
14
|
So if you were told someone were 1,000,000,000 seconds old, you should
|
|
15
|
-
be able to say that they're 31 Earth-years old.
|
|
15
|
+
be able to say that they're 31.69 Earth-years old. Round all ages to
|
|
16
|
+
the nearest hundredth of a year.
|
|
16
17
|
|
|
17
18
|
If you're wondering why Pluto didn't make the cut, go watch [this
|
|
18
19
|
youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Given two lists determine if the first list is contained within the second
|
|
2
|
+
list, if the second list is contained within the first list, if both lists are
|
|
3
|
+
contained within each other or if none of these are true.
|
|
4
|
+
|
|
5
|
+
Specifically, a list A is a sublist of list B if by dropping 0 or more elements
|
|
6
|
+
from the front of B and 0 or more elements from the back of B you get a list
|
|
7
|
+
that's completely equal to A.
|
|
8
|
+
|
|
9
|
+
Examples:
|
|
10
|
+
|
|
11
|
+
* A = [1, 2, 3], B = [1, 2, 3, 4, 5], A is a sublist of B
|
|
12
|
+
* A = [3, 4, 5], B = [1, 2, 3, 4, 5], A is a sublist of B
|
|
13
|
+
* A = [3, 4], B = [1, 2, 3, 4, 5], A is a sublist of B
|
|
14
|
+
* A = [1, 2, 3], B = [1, 2, 3], A is equal to B
|
|
15
|
+
* A = [1, 2, 3, 4, 5], B = [2, 3, 4], A is a superlist of B
|
|
16
|
+
* A = [1, 2, 4], B = [1, 2, 3, 4, 5], A is not a superlist of, sublist of or equal to B
|
|
17
|
+
|
|
18
|
+
## Setup
|
|
19
|
+
|
|
20
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
|
21
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
|
22
|
+
a Lisp implementation and how to run the tests.
|
|
23
|
+
|
|
24
|
+
## Formatting
|
|
25
|
+
|
|
26
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
|
27
|
+
nor whether you use spaces or tabs, this is an important consideration
|
|
28
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
|
29
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
|
30
|
+
the code more readable to the human reviewers. Please review your
|
|
31
|
+
editors settings on how to accomplish this. Below are instructions for
|
|
32
|
+
popular editors for Common Lisp.
|
|
33
|
+
|
|
34
|
+
### VIM
|
|
35
|
+
|
|
36
|
+
Use the following commands to ensure VIM uses only spaces for
|
|
37
|
+
indentation:
|
|
38
|
+
|
|
39
|
+
```vimscript
|
|
40
|
+
:set tabstop=2
|
|
41
|
+
:set shiftwidth=2
|
|
42
|
+
:set expandtab
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
|
46
|
+
be added to your `~/.vimrc` file to use it all the time.
|
|
47
|
+
|
|
48
|
+
### Emacs
|
|
49
|
+
|
|
50
|
+
Emacs is very well suited for editing Common Lisp and has many
|
|
51
|
+
powerful add-on packages available. The only thing that one needs to
|
|
52
|
+
do with a stock emacs to make it work well with exercism.io is to
|
|
53
|
+
evaluate the following code:
|
|
54
|
+
|
|
55
|
+
`(setq indent-tab-mode nil)`
|
|
56
|
+
|
|
57
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
|
58
|
+
order to have it set whenever Emacs is launched.
|
|
59
|
+
|
|
60
|
+
One suggested add-on for Emacs and Common Lisp is
|
|
61
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
|
62
|
+
with the REPL; making iterative coding and testing very easy.
|
|
63
|
+
|
|
64
|
+
## Submitting Incomplete Solutions
|
|
65
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|