trackler 2.2.0.0 → 2.2.0.1
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/CONTRIBUTING.md +1 -1
- data/tracks/bash/.travis.yml +1 -1
- data/tracks/bash/config.json +30 -3
- data/tracks/c/README.md +1 -1
- data/tracks/c/config.json +131 -39
- data/tracks/ceylon/README.md +6 -6
- data/tracks/ceylon/config.json +21 -3
- data/tracks/chapel/.travis.yml +1 -1
- data/tracks/clojurescript/.travis.yml +1 -1
- data/tracks/clojurescript/README.md +6 -6
- data/tracks/clojurescript/exercises/.keep +0 -0
- data/tracks/coffeescript/.travis.yml +1 -1
- data/tracks/coldfusion/.travis.yml +1 -1
- data/tracks/coq/.travis.yml +1 -1
- data/tracks/cpp/CMakeLists.txt +1 -0
- data/tracks/cpp/README.md +1 -1
- data/tracks/cpp/config.json +8 -0
- data/tracks/cpp/exercises/atbash-cipher/CMakeLists.txt +52 -0
- data/tracks/cpp/exercises/atbash-cipher/atbash_cipher_test.cpp +68 -0
- data/tracks/cpp/exercises/atbash-cipher/example.cpp +54 -0
- data/tracks/cpp/exercises/atbash-cipher/example.h +13 -0
- data/tracks/csharp/config.json +315 -6
- data/tracks/d/.travis.yml +1 -1
- data/tracks/dart/README.md +2 -2
- data/tracks/dart/config.json +21 -3
- data/tracks/delphi/README.md +1 -1
- data/tracks/delphi/config.json +83 -1
- data/tracks/ecmascript/config.json +10 -0
- data/tracks/ecmascript/exercises/accumulate/accumulate.spec.js +3 -9
- data/tracks/ecmascript/exercises/acronym/acronym.spec.js +2 -2
- data/tracks/ecmascript/exercises/all-your-base/all-your-base.spec.js +131 -133
- data/tracks/ecmascript/exercises/all-your-base/example.js +1 -3
- data/tracks/ecmascript/exercises/allergies/allergies.spec.js +8 -10
- data/tracks/ecmascript/exercises/allergies/example.js +3 -5
- data/tracks/ecmascript/exercises/alphametics/alphametics.spec.js +61 -63
- data/tracks/ecmascript/exercises/alphametics/example.js +99 -99
- data/tracks/ecmascript/exercises/anagram/anagram.spec.js +35 -37
- data/tracks/ecmascript/exercises/anagram/example.js +1 -3
- data/tracks/ecmascript/exercises/atbash-cipher/atbash-cipher.spec.js +1 -3
- data/tracks/ecmascript/exercises/atbash-cipher/example.js +3 -3
- data/tracks/ecmascript/exercises/beer-song/beer-song.spec.js +0 -2
- data/tracks/ecmascript/exercises/beer-song/example.js +9 -9
- data/tracks/ecmascript/exercises/binary/binary.spec.js +1 -2
- data/tracks/ecmascript/exercises/binary/example.js +3 -3
- data/tracks/ecmascript/exercises/binary-search/binary-search.spec.js +1 -3
- data/tracks/ecmascript/exercises/binary-search-tree/binary-search-tree.spec.js +13 -15
- data/tracks/ecmascript/exercises/binary-search-tree/example.js +2 -2
- data/tracks/ecmascript/exercises/bob/bob.spec.js +1 -3
- data/tracks/ecmascript/exercises/bob/example.js +3 -3
- data/tracks/ecmascript/exercises/bracket-push/example.js +2 -2
- data/tracks/ecmascript/exercises/circular-buffer/circular-buffer.spec.js +10 -12
- data/tracks/ecmascript/exercises/circular-buffer/example.js +12 -11
- data/tracks/ecmascript/exercises/clock/clock.spec.js +0 -8
- data/tracks/ecmascript/exercises/clock/example.js +11 -11
- data/tracks/ecmascript/exercises/connect/connect.spec.js +75 -77
- data/tracks/ecmascript/exercises/connect/example.js +27 -29
- data/tracks/ecmascript/exercises/crypto-square/crypto-square.spec.js +11 -11
- data/tracks/ecmascript/exercises/crypto-square/example.js +11 -10
- data/tracks/ecmascript/exercises/custom-set/custom-set.spec.js +2 -4
- data/tracks/ecmascript/exercises/custom-set/example.js +1 -1
- data/tracks/ecmascript/exercises/diamond/diamond.spec.js +20 -21
- data/tracks/ecmascript/exercises/diamond/example.js +12 -13
- data/tracks/ecmascript/exercises/difference-of-squares/difference-of-squares.spec.js +0 -5
- data/tracks/ecmascript/exercises/diffie-hellman/diffie-hellman.spec.js +7 -28
- data/tracks/ecmascript/exercises/etl/etl.spec.js +36 -18
- data/tracks/ecmascript/exercises/etl/example.js +3 -3
- data/tracks/ecmascript/exercises/flatten-array/example.js +1 -1
- data/tracks/ecmascript/exercises/flatten-array/flatten-array.spec.js +2 -3
- data/tracks/ecmascript/exercises/food-chain/example.js +12 -12
- data/tracks/ecmascript/exercises/food-chain/food-chain.spec.js +0 -1
- data/tracks/ecmascript/exercises/gigasecond/example.js +1 -1
- data/tracks/ecmascript/exercises/gigasecond/gigasecond.spec.js +0 -1
- data/tracks/ecmascript/exercises/grade-school/grade-school.spec.js +18 -19
- data/tracks/ecmascript/exercises/grains/grains.spec.js +0 -1
- data/tracks/ecmascript/exercises/hamming/example.js +3 -3
- data/tracks/ecmascript/exercises/hamming/hamming.spec.js +5 -6
- data/tracks/ecmascript/exercises/hello-world/example.js +1 -1
- data/tracks/ecmascript/exercises/hello-world/hello-world.spec.js +1 -1
- data/tracks/ecmascript/exercises/hexadecimal/example.js +2 -2
- data/tracks/ecmascript/exercises/hexadecimal/hexadecimal.spec.js +9 -11
- data/tracks/ecmascript/exercises/isogram/isogram.spec.js +22 -23
- data/tracks/ecmascript/exercises/kindergarten-garden/example.js +7 -7
- data/tracks/ecmascript/exercises/kindergarten-garden/kindergarten-garden.spec.js +0 -5
- data/tracks/ecmascript/exercises/largest-series-product/example.js +4 -8
- data/tracks/ecmascript/exercises/largest-series-product/largest-series-product.spec.js +5 -7
- data/tracks/ecmascript/exercises/leap/leap.spec.js +4 -6
- data/tracks/ecmascript/exercises/linked-list/example.js +2 -2
- data/tracks/ecmascript/exercises/list-ops/example.js +19 -19
- data/tracks/ecmascript/exercises/list-ops/list-ops.spec.js +2 -18
- data/tracks/ecmascript/exercises/luhn/example.js +1 -1
- data/tracks/ecmascript/exercises/luhn/luhn.spec.js +1 -3
- data/tracks/ecmascript/exercises/matrix/example.js +2 -4
- data/tracks/ecmascript/exercises/matrix/matrix.spec.js +0 -2
- data/tracks/ecmascript/exercises/meetup/example.js +12 -15
- data/tracks/ecmascript/exercises/meetup/meetup.spec.js +0 -2
- data/tracks/ecmascript/exercises/minesweeper/example.js +60 -0
- data/tracks/ecmascript/exercises/minesweeper/minesweeper.spec.js +174 -0
- data/tracks/ecmascript/exercises/minesweeper/package.json +69 -0
- data/tracks/ecmascript/exercises/nth-prime/example.js +3 -2
- data/tracks/ecmascript/exercises/nth-prime/nth-prime.spec.js +0 -1
- data/tracks/ecmascript/exercises/ocr-numbers/example.js +3 -3
- data/tracks/ecmascript/exercises/ocr-numbers/ocr-numbers.spec.js +16 -18
- data/tracks/ecmascript/exercises/octal/example.js +1 -1
- data/tracks/ecmascript/exercises/octal/octal.spec.js +0 -2
- data/tracks/ecmascript/exercises/palindrome-products/example.js +14 -11
- data/tracks/ecmascript/exercises/palindrome-products/palindrome-products.spec.js +15 -18
- data/tracks/ecmascript/exercises/pangram/example.js +6 -5
- data/tracks/ecmascript/exercises/pangram/pangram.spec.js +10 -12
- data/tracks/ecmascript/exercises/pascals-triangle/example.js +2 -2
- data/tracks/ecmascript/exercises/pascals-triangle/pascals-triangle.spec.js +6 -8
- data/tracks/ecmascript/exercises/perfect-numbers/example.js +3 -5
- data/tracks/ecmascript/exercises/perfect-numbers/perfect-numbers.spec.js +0 -10
- data/tracks/ecmascript/exercises/phone-number/example.js +2 -2
- data/tracks/ecmascript/exercises/phone-number/phone-number.spec.js +0 -2
- data/tracks/ecmascript/exercises/pig-latin/example.js +4 -4
- data/tracks/ecmascript/exercises/pig-latin/pig-latin.spec.js +0 -1
- data/tracks/ecmascript/exercises/prime-factors/example.js +2 -2
- data/tracks/ecmascript/exercises/prime-factors/prime-factors.spec.js +0 -2
- data/tracks/ecmascript/exercises/pythagorean-triplet/pythagorean-triplet.spec.js +3 -11
- data/tracks/ecmascript/exercises/queen-attack/example.js +17 -17
- data/tracks/ecmascript/exercises/queen-attack/queen-attack.spec.js +7 -8
- data/tracks/ecmascript/exercises/raindrops/example.js +1 -1
- data/tracks/ecmascript/exercises/raindrops/raindrops.spec.js +1 -2
- data/tracks/ecmascript/exercises/rna-transcription/example.js +5 -5
- data/tracks/ecmascript/exercises/rna-transcription/rna-transcription.spec.js +4 -5
- data/tracks/ecmascript/exercises/robot-name/example.js +6 -6
- data/tracks/ecmascript/exercises/robot-name/robot-name.spec.js +10 -11
- data/tracks/ecmascript/exercises/robot-simulator/example.js +1 -1
- data/tracks/ecmascript/exercises/robot-simulator/robot-simulator.spec.js +31 -32
- data/tracks/ecmascript/exercises/roman-numerals/example.js +16 -16
- data/tracks/ecmascript/exercises/saddle-points/saddle-points.spec.js +3 -3
- data/tracks/ecmascript/exercises/say/example.js +25 -25
- data/tracks/ecmascript/exercises/say/say.spec.js +2 -3
- data/tracks/ecmascript/exercises/scrabble-score/example.js +27 -9
- data/tracks/ecmascript/exercises/scrabble-score/scrabble-score.spec.js +6 -7
- data/tracks/ecmascript/exercises/secret-handshake/example.js +2 -3
- data/tracks/ecmascript/exercises/secret-handshake/secret-handshake.spec.js +3 -5
- data/tracks/ecmascript/exercises/series/series.spec.js +1 -3
- data/tracks/ecmascript/exercises/sieve/example.js +4 -3
- data/tracks/ecmascript/exercises/sieve/sieve.spec.js +0 -2
- data/tracks/ecmascript/exercises/simple-cipher/example.js +8 -9
- data/tracks/ecmascript/exercises/simple-cipher/simple-cipher.spec.js +4 -4
- data/tracks/ecmascript/exercises/space-age/example.js +1 -1
- data/tracks/ecmascript/exercises/space-age/space-age.spec.js +9 -11
- data/tracks/ecmascript/exercises/strain/example.js +4 -4
- data/tracks/ecmascript/exercises/strain/strain.spec.js +14 -16
- data/tracks/ecmascript/exercises/sum-of-multiples/example.js +4 -4
- data/tracks/ecmascript/exercises/triangle/triangle.spec.js +2 -4
- data/tracks/ecmascript/exercises/trinary/example.js +3 -3
- data/tracks/ecmascript/exercises/trinary/trinary.spec.js +0 -2
- data/tracks/ecmascript/exercises/two-bucket/example.js +30 -27
- data/tracks/ecmascript/exercises/two-bucket/two-bucket.spec.js +4 -8
- data/tracks/ecmascript/exercises/word-count/example.js +2 -2
- data/tracks/ecmascript/exercises/word-count/word-count.spec.js +2 -3
- data/tracks/ecmascript/exercises/wordy/example.js +6 -6
- data/tracks/ecmascript/exercises/wordy/wordy.spec.js +2 -4
- data/tracks/factor/config.json +15 -6
- data/tracks/fortran/.travis.yml +1 -1
- data/tracks/fsharp/config.json +312 -10
- data/tracks/go/README.md +1 -1
- data/tracks/go/config.json +523 -155
- data/tracks/haskell/README.md +2 -2
- data/tracks/haskell/config.json +256 -7
- data/tracks/haxe/.travis.yml +1 -1
- data/tracks/haxe/Makefile +2 -2
- data/tracks/haxe/config.json +8 -5
- data/tracks/java/CONTRIBUTING.md +2 -2
- data/tracks/java/config.json +277 -17
- data/tracks/java/exercises/rotational-cipher/build.gradle +17 -0
- data/tracks/java/exercises/rotational-cipher/src/example/java/RotationalCipher.java +37 -0
- data/tracks/java/exercises/rotational-cipher/src/main/java/.keep +0 -0
- data/tracks/java/exercises/rotational-cipher/src/test/java/RotationalCipherTest.java +81 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/java/exercises/twelve-days/src/main/java/TwelveDays.java +4 -0
- data/tracks/julia/.travis.yml +1 -1
- data/tracks/julia/README.md +1 -1
- data/tracks/kotlin/README.md +2 -2
- data/tracks/kotlin/exercises/hello-world/TUTORIAL.md +3 -3
- data/tracks/lisp/config.json +97 -3
- data/tracks/lisp/exercises/pascals-triangle/example.lisp +21 -0
- data/tracks/lisp/exercises/pascals-triangle/pascal.lisp +7 -0
- data/tracks/lisp/exercises/pascals-triangle/pascals-triangle-test.lisp +34 -0
- data/tracks/lua/.travis.yml +1 -1
- data/tracks/lua/README.md +1 -1
- data/tracks/mips/.travis.yml +1 -1
- data/tracks/mips/config.json +56 -17
- data/tracks/nasm/.travis.yml +1 -1
- data/tracks/nim/.travis.yml +1 -1
- data/tracks/ocaml/README.md +3 -3
- data/tracks/ocaml/config.json +130 -4
- data/tracks/perl5/docs/TESTS.md +40 -26
- data/tracks/plsql/.travis.yml +1 -1
- data/tracks/plsql/config.json +40 -13
- data/tracks/pony/.travis.yml +1 -1
- data/tracks/pony/bin/install-deps +4 -3
- data/tracks/prolog/.travis.yml +1 -1
- data/tracks/r/README.md +5 -5
- data/tracks/r/config.json +102 -30
- data/tracks/rust/.travis.yml +1 -1
- data/tracks/rust/config.json +172 -4
- data/tracks/rust/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/sml/config.json +26 -3
- data/tracks/vimscript/config.json +60 -3
- metadata +16 -1
@@ -0,0 +1,17 @@
|
|
1
|
+
apply plugin: "java"
|
2
|
+
apply plugin: "eclipse"
|
3
|
+
apply plugin: "idea"
|
4
|
+
|
5
|
+
repositories {
|
6
|
+
mavenCentral()
|
7
|
+
}
|
8
|
+
|
9
|
+
dependencies {
|
10
|
+
testCompile "junit:junit:4.12"
|
11
|
+
}
|
12
|
+
test {
|
13
|
+
testLogging {
|
14
|
+
exceptionFormat = 'full'
|
15
|
+
events = ["passed", "failed", "skipped"]
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
public class RotationalCipher {
|
3
|
+
|
4
|
+
int shiftKey;
|
5
|
+
|
6
|
+
RotationalCipher(int shiftKey) {
|
7
|
+
this.shiftKey = shiftKey;
|
8
|
+
}
|
9
|
+
|
10
|
+
public String rotate(String data) {
|
11
|
+
StringBuilder dataStringBuilder = new StringBuilder();
|
12
|
+
for (char c : data.toCharArray()) {
|
13
|
+
if (Character.isUpperCase(c)) {
|
14
|
+
dataStringBuilder.append(getReplacementCharacter(c, 'A', 'Z'));
|
15
|
+
} else if (Character.isLowerCase(c)) {
|
16
|
+
dataStringBuilder.append(getReplacementCharacter(c, 'a', 'z'));
|
17
|
+
} else {
|
18
|
+
dataStringBuilder.append(c);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return dataStringBuilder.toString();
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* For Uppercase CaseStart = 'A' and CaseEnd = 'Z'
|
26
|
+
* For Lowercase CaseStart = 'a' and CaseEnd = 'z'
|
27
|
+
*/
|
28
|
+
private char getReplacementCharacter(char characterToReplace,
|
29
|
+
char alphabetCaseStart, char alphabetCaseEnd) {
|
30
|
+
char replacementCharacter = (char) (characterToReplace + shiftKey);
|
31
|
+
if (replacementCharacter > alphabetCaseEnd) {
|
32
|
+
replacementCharacter = (char) ((alphabetCaseStart - 1) +
|
33
|
+
(replacementCharacter % alphabetCaseEnd));
|
34
|
+
}
|
35
|
+
return replacementCharacter;
|
36
|
+
}
|
37
|
+
}
|
File without changes
|
@@ -0,0 +1,81 @@
|
|
1
|
+
|
2
|
+
import org.junit.Assert;
|
3
|
+
import org.junit.Before;
|
4
|
+
import org.junit.Ignore;
|
5
|
+
import org.junit.Test;
|
6
|
+
|
7
|
+
public class RotationalCipherTest {
|
8
|
+
|
9
|
+
private RotationalCipher rotationalCipher;
|
10
|
+
|
11
|
+
@Test
|
12
|
+
public void rotateSingleCharacterBy1() {
|
13
|
+
rotationalCipher = new RotationalCipher(1);
|
14
|
+
Assert.assertEquals("b", rotationalCipher.rotate("a"));
|
15
|
+
}
|
16
|
+
|
17
|
+
@Ignore("Remove to run test")
|
18
|
+
@Test
|
19
|
+
public void rotateSingleCharacterBy26() {
|
20
|
+
rotationalCipher = new RotationalCipher(26);
|
21
|
+
Assert.assertEquals("a", rotationalCipher.rotate("a"));
|
22
|
+
}
|
23
|
+
|
24
|
+
@Ignore("Remove to run test")
|
25
|
+
@Test
|
26
|
+
public void rotateSingleCharacterBy0() {
|
27
|
+
rotationalCipher = new RotationalCipher(0);
|
28
|
+
Assert.assertEquals("a", rotationalCipher.rotate("a"));
|
29
|
+
}
|
30
|
+
|
31
|
+
@Ignore("Remove to run test")
|
32
|
+
@Test
|
33
|
+
public void rotateSingleCharacterBy13() {
|
34
|
+
rotationalCipher = new RotationalCipher(13);
|
35
|
+
Assert.assertEquals("z", rotationalCipher.rotate("m"));
|
36
|
+
}
|
37
|
+
|
38
|
+
@Ignore("Remove to run test")
|
39
|
+
@Test
|
40
|
+
public void rotateSingleCharacterWithWrapAround() {
|
41
|
+
rotationalCipher = new RotationalCipher(13);
|
42
|
+
Assert.assertEquals("a", rotationalCipher.rotate("n"));
|
43
|
+
}
|
44
|
+
|
45
|
+
@Ignore("Remove to run test")
|
46
|
+
@Test
|
47
|
+
public void rotateCapitalLetters() {
|
48
|
+
rotationalCipher = new RotationalCipher(5);
|
49
|
+
Assert.assertEquals("TRL", rotationalCipher.rotate("OMG"));
|
50
|
+
}
|
51
|
+
|
52
|
+
@Ignore("Remove to run test")
|
53
|
+
@Test
|
54
|
+
public void rotateSpaces() {
|
55
|
+
rotationalCipher = new RotationalCipher(5);
|
56
|
+
Assert.assertEquals("T R L", rotationalCipher.rotate("O M G"));
|
57
|
+
}
|
58
|
+
|
59
|
+
@Ignore("Remove to run test")
|
60
|
+
@Test
|
61
|
+
public void rotateNumbers() {
|
62
|
+
rotationalCipher = new RotationalCipher(4);
|
63
|
+
Assert.assertEquals("Xiwxmrk 1 2 3 xiwxmrk", rotationalCipher.rotate("Testing 1 2 3 testing"));
|
64
|
+
}
|
65
|
+
|
66
|
+
@Ignore("Remove to run test")
|
67
|
+
@Test
|
68
|
+
public void rotatePunctuation() {
|
69
|
+
rotationalCipher = new RotationalCipher(21);
|
70
|
+
Assert.assertEquals("Gzo'n zvo, Bmviyhv!", rotationalCipher.rotate("Let's eat, Grandma!"));
|
71
|
+
}
|
72
|
+
|
73
|
+
@Ignore("Remove to run test")
|
74
|
+
@Test
|
75
|
+
public void rotateAllLetters() {
|
76
|
+
rotationalCipher = new RotationalCipher(13);
|
77
|
+
Assert.assertEquals("The quick brown fox jumps over the lazy dog.",
|
78
|
+
rotationalCipher.rotate("Gur dhvpx oebja sbk whzcf bire gur ynml qbt."));
|
79
|
+
}
|
80
|
+
|
81
|
+
}
|
@@ -6,4 +6,8 @@ class TwelveDays {
|
|
6
6
|
String verses(int startVerse, int endVerse) {
|
7
7
|
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
|
8
8
|
}
|
9
|
+
|
10
|
+
String sing() {
|
11
|
+
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
|
12
|
+
}
|
9
13
|
}
|
data/tracks/julia/.travis.yml
CHANGED
data/tracks/julia/README.md
CHANGED
@@ -11,7 +11,7 @@ _Document how to contribute to the Julia track._
|
|
11
11
|
|
12
12
|
## Contributing Guide
|
13
13
|
|
14
|
-
Please see the [contributing guide](https://github.com/exercism/
|
14
|
+
Please see the [contributing guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
|
15
15
|
|
16
16
|
## Working on the Exercises
|
17
17
|
|
data/tracks/kotlin/README.md
CHANGED
@@ -34,7 +34,7 @@ To submit a fix for an existing exercise or port an exercise to Kotlin with the
|
|
34
34
|
(see [exercism.io: Installing Kotlin](http://exercism.io/languages/kotlin/installing))
|
35
35
|
- **Setup a branch on a fork of [exercism/kotlin](https://github.com/exercism/kotlin) on your computer.**
|
36
36
|
|
37
|
-
Use those instructions (in conjunction with the [Git Basics doc](https://github.com/exercism/docs/blob/master/contributing
|
37
|
+
Use those instructions (in conjunction with the [Git Basics doc](https://github.com/exercism/docs/blob/master/contributing/git-basics.md)) to:
|
38
38
|
* "fork" a repository on GitHub;
|
39
39
|
- install `git`;
|
40
40
|
- "clone" a copy of your fork;
|
@@ -52,7 +52,7 @@ Use those instructions (in conjunction with the [Git Basics doc](https://github.
|
|
52
52
|
$ git push
|
53
53
|
```
|
54
54
|
|
55
|
-
The Git Basics doc has a section on [commit messages](https://github.com/exercism/docs/blob/master/contributing
|
55
|
+
The Git Basics doc has a section on [commit messages](https://github.com/exercism/docs/blob/master/contributing/git-basics.md#commit-messages) that provides practical advice on crafting meaningful commit messages.
|
56
56
|
- **Verify that your work passes all tests.** When you create a pull request (PR), GitHub triggers a build on Travis CI. Your PR will not be merged unless those tests pass.
|
57
57
|
|
58
58
|
## Getting Familiar With the Codebase
|
@@ -153,7 +153,7 @@ In your favorite text editor, open `src/test/kotlin/HelloWorldTest.kt`
|
|
153
153
|
and go to line 10.
|
154
154
|
|
155
155
|
```kotlin
|
156
|
-
assertEquals("Hello, World!", hello(""))
|
156
|
+
assertEquals("Hello, World!", hello(""))
|
157
157
|
```
|
158
158
|
|
159
159
|
The test is expecting that `hello()`, when given an empty string (`""`),
|
@@ -551,7 +551,7 @@ fun hello(name: String = ""): String {
|
|
551
551
|
}
|
552
552
|
|
553
553
|
private fun whom(name: String):String {
|
554
|
-
return if(name.isBlank()) "World" else name
|
554
|
+
return if(name.isBlank()) "World" else name
|
555
555
|
}
|
556
556
|
```
|
557
557
|
|
@@ -679,7 +679,7 @@ than 100 maintainers and many more contributors.
|
|
679
679
|
|
680
680
|
A starting point to jumping in can be found here:
|
681
681
|
|
682
|
-
https://github.com/exercism/
|
682
|
+
https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md
|
683
683
|
|
684
684
|
----
|
685
685
|
|
data/tracks/lisp/config.json
CHANGED
@@ -5,7 +5,10 @@
|
|
5
5
|
"active": true,
|
6
6
|
"exercises": [
|
7
7
|
{
|
8
|
+
"uuid": "c029678b-9b9f-4fb2-958f-3a118efa16a9",
|
8
9
|
"slug": "hamming",
|
10
|
+
"core": false,
|
11
|
+
"unlocked_by": null,
|
9
12
|
"difficulty": 1,
|
10
13
|
"topics": [
|
11
14
|
"Control-flow (conditionals)",
|
@@ -16,7 +19,10 @@
|
|
16
19
|
]
|
17
20
|
},
|
18
21
|
{
|
22
|
+
"uuid": "8bfa54a8-4ee6-4e6e-b286-7fc8c70b9e9f",
|
19
23
|
"slug": "leap",
|
24
|
+
"core": false,
|
25
|
+
"unlocked_by": null,
|
20
26
|
"difficulty": 1,
|
21
27
|
"topics": [
|
22
28
|
"Control-flow (conditionals)",
|
@@ -26,7 +32,10 @@
|
|
26
32
|
]
|
27
33
|
},
|
28
34
|
{
|
35
|
+
"uuid": "eb3a92bf-0748-4406-ba67-9e27e367ae45",
|
29
36
|
"slug": "grains",
|
37
|
+
"core": false,
|
38
|
+
"unlocked_by": null,
|
30
39
|
"difficulty": 1,
|
31
40
|
"topics": [
|
32
41
|
"Variables",
|
@@ -35,7 +44,10 @@
|
|
35
44
|
]
|
36
45
|
},
|
37
46
|
{
|
47
|
+
"uuid": "25506c31-7274-402a-95e1-8475fcdb34e1",
|
38
48
|
"slug": "gigasecond",
|
49
|
+
"core": false,
|
50
|
+
"unlocked_by": null,
|
39
51
|
"difficulty": 1,
|
40
52
|
"topics": [
|
41
53
|
"Variables",
|
@@ -46,7 +58,10 @@
|
|
46
58
|
]
|
47
59
|
},
|
48
60
|
{
|
61
|
+
"uuid": "1e6c8365-775d-4a4f-8fc7-e376912d7912",
|
49
62
|
"slug": "bob",
|
63
|
+
"core": false,
|
64
|
+
"unlocked_by": null,
|
50
65
|
"difficulty": 1,
|
51
66
|
"topics": [
|
52
67
|
"Control-flow (conditionals)",
|
@@ -55,7 +70,10 @@
|
|
55
70
|
]
|
56
71
|
},
|
57
72
|
{
|
73
|
+
"uuid": "5c215cbf-a575-42ad-9b3f-892410a63077",
|
58
74
|
"slug": "rna-transcription",
|
75
|
+
"core": false,
|
76
|
+
"unlocked_by": null,
|
59
77
|
"difficulty": 1,
|
60
78
|
"topics": [
|
61
79
|
"Control-flow (conditionals)",
|
@@ -64,7 +82,10 @@
|
|
64
82
|
]
|
65
83
|
},
|
66
84
|
{
|
85
|
+
"uuid": "79a4a35c-40d6-4e2d-92a1-005c40b4f4c5",
|
67
86
|
"slug": "robot-name",
|
87
|
+
"core": false,
|
88
|
+
"unlocked_by": null,
|
68
89
|
"difficulty": 1,
|
69
90
|
"topics": [
|
70
91
|
"Variables",
|
@@ -73,7 +94,10 @@
|
|
73
94
|
]
|
74
95
|
},
|
75
96
|
{
|
97
|
+
"uuid": "424ed7aa-24f3-4aec-9620-3cc9dc224166",
|
76
98
|
"slug": "word-count",
|
99
|
+
"core": false,
|
100
|
+
"unlocked_by": null,
|
77
101
|
"difficulty": 1,
|
78
102
|
"topics": [
|
79
103
|
"Control-flow (conditionals)",
|
@@ -83,7 +107,10 @@
|
|
83
107
|
]
|
84
108
|
},
|
85
109
|
{
|
110
|
+
"uuid": "b5345fcb-d4cc-4ea0-b1b9-f1b0cb92f05c",
|
86
111
|
"slug": "raindrops",
|
112
|
+
"core": false,
|
113
|
+
"unlocked_by": null,
|
87
114
|
"difficulty": 1,
|
88
115
|
"topics": [
|
89
116
|
"Control-flow (conditionals)",
|
@@ -92,7 +119,10 @@
|
|
92
119
|
]
|
93
120
|
},
|
94
121
|
{
|
122
|
+
"uuid": "841641f2-16ba-4dc5-af1b-ffae5052853a",
|
95
123
|
"slug": "grade-school",
|
124
|
+
"core": false,
|
125
|
+
"unlocked_by": null,
|
96
126
|
"difficulty": 1,
|
97
127
|
"topics": [
|
98
128
|
"Interfaces",
|
@@ -103,7 +133,10 @@
|
|
103
133
|
]
|
104
134
|
},
|
105
135
|
{
|
136
|
+
"uuid": "d1d86b51-a3f4-4276-a18c-6db54bc8dfcc",
|
106
137
|
"slug": "phone-number",
|
138
|
+
"core": false,
|
139
|
+
"unlocked_by": null,
|
107
140
|
"difficulty": 1,
|
108
141
|
"topics": [
|
109
142
|
"Interfaces",
|
@@ -112,7 +145,10 @@
|
|
112
145
|
]
|
113
146
|
},
|
114
147
|
{
|
148
|
+
"uuid": "52ac3dd0-8803-445f-93cf-e984b59d6702",
|
115
149
|
"slug": "etl",
|
150
|
+
"core": false,
|
151
|
+
"unlocked_by": null,
|
116
152
|
"difficulty": 1,
|
117
153
|
"topics": [
|
118
154
|
"Control-flow (loops)",
|
@@ -121,7 +157,10 @@
|
|
121
157
|
]
|
122
158
|
},
|
123
159
|
{
|
160
|
+
"uuid": "5c6f22e7-109c-4d9e-b8bf-4ea63b2823ca",
|
124
161
|
"slug": "beer-song",
|
162
|
+
"core": false,
|
163
|
+
"unlocked_by": null,
|
125
164
|
"difficulty": 1,
|
126
165
|
"topics": [
|
127
166
|
"Control-flow (conditionals)",
|
@@ -131,7 +170,10 @@
|
|
131
170
|
]
|
132
171
|
},
|
133
172
|
{
|
173
|
+
"uuid": "d24cf0ea-876f-4775-969b-99970425e413",
|
134
174
|
"slug": "space-age",
|
175
|
+
"core": false,
|
176
|
+
"unlocked_by": null,
|
135
177
|
"difficulty": 1,
|
136
178
|
"topics": [
|
137
179
|
"Interfaces",
|
@@ -140,7 +182,10 @@
|
|
140
182
|
]
|
141
183
|
},
|
142
184
|
{
|
185
|
+
"uuid": "b9fd0f13-966c-4085-ac9d-ed49a96ac0bf",
|
143
186
|
"slug": "anagram",
|
187
|
+
"core": false,
|
188
|
+
"unlocked_by": null,
|
144
189
|
"difficulty": 1,
|
145
190
|
"topics": [
|
146
191
|
"Equality",
|
@@ -149,7 +194,10 @@
|
|
149
194
|
]
|
150
195
|
},
|
151
196
|
{
|
197
|
+
"uuid": "b2ad38c2-2962-4a47-9b14-20ca262ebff6",
|
152
198
|
"slug": "nucleotide-count",
|
199
|
+
"core": false,
|
200
|
+
"unlocked_by": null,
|
153
201
|
"difficulty": 1,
|
154
202
|
"topics": [
|
155
203
|
"Control-flow (loops)",
|
@@ -159,7 +207,10 @@
|
|
159
207
|
]
|
160
208
|
},
|
161
209
|
{
|
210
|
+
"uuid": "6c702aa9-70f3-41d0-bc76-4323a08f8fbf",
|
162
211
|
"slug": "meetup",
|
212
|
+
"core": false,
|
213
|
+
"unlocked_by": null,
|
163
214
|
"difficulty": 1,
|
164
215
|
"topics": [
|
165
216
|
"Control-flow (conditionals)",
|
@@ -168,7 +219,10 @@
|
|
168
219
|
]
|
169
220
|
},
|
170
221
|
{
|
222
|
+
"uuid": "bd2a55e3-9874-4d2e-ad6f-4b2f8c5e2e0a",
|
171
223
|
"slug": "triangle",
|
224
|
+
"core": false,
|
225
|
+
"unlocked_by": null,
|
172
226
|
"difficulty": 1,
|
173
227
|
"topics": [
|
174
228
|
"Control-flow (conditionals)",
|
@@ -179,7 +233,10 @@
|
|
179
233
|
]
|
180
234
|
},
|
181
235
|
{
|
236
|
+
"uuid": "71804ace-6ca1-46b9-bf06-ff57faef7afa",
|
182
237
|
"slug": "difference-of-squares",
|
238
|
+
"core": false,
|
239
|
+
"unlocked_by": null,
|
183
240
|
"difficulty": 1,
|
184
241
|
"topics": [
|
185
242
|
"Control-flow (loops)",
|
@@ -189,7 +246,10 @@
|
|
189
246
|
]
|
190
247
|
},
|
191
248
|
{
|
249
|
+
"uuid": "150d3608-d234-4c9e-ab6d-2d91f8a2c855",
|
192
250
|
"slug": "roman-numerals",
|
251
|
+
"core": false,
|
252
|
+
"unlocked_by": null,
|
193
253
|
"difficulty": 1,
|
194
254
|
"topics": [
|
195
255
|
"Control-flow (conditionals)",
|
@@ -200,7 +260,10 @@
|
|
200
260
|
]
|
201
261
|
},
|
202
262
|
{
|
263
|
+
"uuid": "f350f23d-72f8-4f47-a0f5-fe3c00f3f5f1",
|
203
264
|
"slug": "scrabble-score",
|
265
|
+
"core": false,
|
266
|
+
"unlocked_by": null,
|
204
267
|
"difficulty": 1,
|
205
268
|
"topics": [
|
206
269
|
"Control-flow (loops)",
|
@@ -210,7 +273,10 @@
|
|
210
273
|
]
|
211
274
|
},
|
212
275
|
{
|
276
|
+
"uuid": "005ff8b4-9df8-4b82-b919-a0c67356d654",
|
213
277
|
"slug": "binary",
|
278
|
+
"core": false,
|
279
|
+
"unlocked_by": null,
|
214
280
|
"difficulty": 1,
|
215
281
|
"topics": [
|
216
282
|
"Control-flow (conditionals)",
|
@@ -219,7 +285,10 @@
|
|
219
285
|
]
|
220
286
|
},
|
221
287
|
{
|
288
|
+
"uuid": "d2fd481e-7156-452d-976d-ea6df220fa18",
|
222
289
|
"slug": "allergies",
|
290
|
+
"core": false,
|
291
|
+
"unlocked_by": null,
|
223
292
|
"difficulty": 1,
|
224
293
|
"topics": [
|
225
294
|
"Control-flow (conditionals)",
|
@@ -229,7 +298,10 @@
|
|
229
298
|
]
|
230
299
|
},
|
231
300
|
{
|
301
|
+
"uuid": "40f3b911-0739-4fec-95cc-cfab99788c19",
|
232
302
|
"slug": "sieve",
|
303
|
+
"core": false,
|
304
|
+
"unlocked_by": null,
|
233
305
|
"difficulty": 1,
|
234
306
|
"topics": [
|
235
307
|
"Control-flow (conditionals)",
|
@@ -241,7 +313,10 @@
|
|
241
313
|
]
|
242
314
|
},
|
243
315
|
{
|
316
|
+
"uuid": "1a81aac9-9128-48ab-aa6a-4d981d6eb602",
|
244
317
|
"slug": "strain",
|
318
|
+
"core": false,
|
319
|
+
"unlocked_by": null,
|
245
320
|
"difficulty": 1,
|
246
321
|
"topics": [
|
247
322
|
"Control-flow (conditionals)",
|
@@ -251,7 +326,10 @@
|
|
251
326
|
]
|
252
327
|
},
|
253
328
|
{
|
329
|
+
"uuid": "71a1fdb6-414e-452c-8d24-03f2a5621e62",
|
254
330
|
"slug": "atbash-cipher",
|
331
|
+
"core": false,
|
332
|
+
"unlocked_by": null,
|
255
333
|
"difficulty": 1,
|
256
334
|
"topics": [
|
257
335
|
"Control-flow (conditionals)",
|
@@ -261,7 +339,10 @@
|
|
261
339
|
]
|
262
340
|
},
|
263
341
|
{
|
342
|
+
"uuid": "cc138097-7c0f-44b4-b07e-2a24f6475986",
|
264
343
|
"slug": "prime-factors",
|
344
|
+
"core": false,
|
345
|
+
"unlocked_by": null,
|
265
346
|
"difficulty": 1,
|
266
347
|
"topics": [
|
267
348
|
"Control-flow (conditionals)",
|
@@ -273,7 +354,10 @@
|
|
273
354
|
]
|
274
355
|
},
|
275
356
|
{
|
357
|
+
"uuid": "fcfc6b44-597d-4a03-bf02-6be5c8f7ae4e",
|
276
358
|
"slug": "crypto-square",
|
359
|
+
"core": false,
|
360
|
+
"unlocked_by": null,
|
277
361
|
"difficulty": 1,
|
278
362
|
"topics": [
|
279
363
|
"Control-flow (conditionals)",
|
@@ -284,17 +368,27 @@
|
|
284
368
|
]
|
285
369
|
},
|
286
370
|
{
|
371
|
+
"uuid": "ff3eb2c5-c7ce-4352-805c-e01d4fb85aa6",
|
287
372
|
"slug": "trinary",
|
373
|
+
"core": false,
|
374
|
+
"unlocked_by": null,
|
288
375
|
"difficulty": 1,
|
289
376
|
"topics": [
|
290
377
|
"Control-flow (conditionals)",
|
291
378
|
"Integers",
|
292
379
|
"Mathematics"
|
293
380
|
]
|
381
|
+
},
|
382
|
+
{
|
383
|
+
"slug": "pascals-triangle",
|
384
|
+
"difficulty": 1,
|
385
|
+
"topics": [
|
386
|
+
"Control-flow (loops)",
|
387
|
+
"Mathematics",
|
388
|
+
"Integers",
|
389
|
+
"Sequences"
|
390
|
+
]
|
294
391
|
}
|
295
|
-
],
|
296
|
-
"deprecated": [
|
297
|
-
|
298
392
|
],
|
299
393
|
"foregone": [
|
300
394
|
"accumulate",
|
@@ -0,0 +1,21 @@
|
|
1
|
+
(defpackage #:pascal
|
2
|
+
(:use #:common-lisp)
|
3
|
+
(:export #:rows))
|
4
|
+
|
5
|
+
(in-package #:pascal)
|
6
|
+
|
7
|
+
(defun fact (n)
|
8
|
+
(loop for i from 0 to n
|
9
|
+
for fact = 1 then (* fact i)
|
10
|
+
finally (return fact)))
|
11
|
+
|
12
|
+
(defun choose (n r)
|
13
|
+
(/ (fact n)
|
14
|
+
(* (fact r) (fact (- n r)))))
|
15
|
+
|
16
|
+
(defun rows (n)
|
17
|
+
(if (> n 0)
|
18
|
+
(loop for i from 0 to (1- n)
|
19
|
+
collect (loop for j from 0 to i
|
20
|
+
collect (choose i j)))
|
21
|
+
'()))
|
@@ -0,0 +1,34 @@
|
|
1
|
+
(ql:quickload "lisp-unit")
|
2
|
+
#-xlisp-test (load "pascal")
|
3
|
+
|
4
|
+
(defpackage #:pascal-test
|
5
|
+
(:use #:common-lisp #:lisp-unit))
|
6
|
+
(in-package #:pascal-test)
|
7
|
+
|
8
|
+
(define-test zero-rows
|
9
|
+
(assert-equal '()
|
10
|
+
(pascal:rows 0)))
|
11
|
+
|
12
|
+
(define-test single-row
|
13
|
+
(assert-equal '((1))
|
14
|
+
(pascal:rows 1)))
|
15
|
+
|
16
|
+
(define-test two-rows
|
17
|
+
(assert-equal '((1) (1 1))
|
18
|
+
(pascal:rows 2)))
|
19
|
+
|
20
|
+
(define-test three-rows
|
21
|
+
(assert-equal '((1) (1 1) (1 2 1))
|
22
|
+
(pascal:rows 3)))
|
23
|
+
|
24
|
+
(define-test four-rows
|
25
|
+
(assert-equal '((1) (1 1) (1 2 1) (1 3 3 1))
|
26
|
+
(pascal:rows 4)))
|
27
|
+
|
28
|
+
(define-test negative-rows
|
29
|
+
(assert-equal '()
|
30
|
+
(pascal:rows -1)))
|
31
|
+
#-xlisp-test
|
32
|
+
(let ((*print-errors* t)
|
33
|
+
(*print-failures* t))
|
34
|
+
(run-tests :all :pascal-test))
|
data/tracks/lua/.travis.yml
CHANGED
data/tracks/lua/README.md
CHANGED
@@ -62,6 +62,6 @@ The Lua icon is inspired by the [Lua logo][9], which was designed by Alexandre N
|
|
62
62
|
[4]: https://github.com/exercism/lua/tree/master/exercises/bob
|
63
63
|
[5]: https://github.com/exercism/lua/blob/master/config.json
|
64
64
|
[6]: https://github.com/exercism/docs/tree/master/contributing-to-language-tracks
|
65
|
-
[7]: https://github.com/exercism/docs/blob/master/contributing
|
65
|
+
[7]: https://github.com/exercism/docs/blob/master/contributing/pull-request-guidelines.md
|
66
66
|
[8]: http://exercism.io/languages/lua/resources
|
67
67
|
[9]: http://www.lua.org/images/
|
data/tracks/mips/.travis.yml
CHANGED