trackler 2.2.1.81 → 2.2.1.82
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/tracks/bash/exercises/triangle/triangle_test.sh +1 -1
- data/tracks/common-lisp/config.json +2 -2
- data/tracks/cpp/config.json +4 -4
- data/tracks/elixir/config.json +1 -1
- data/tracks/go/exercises/bob/.meta/gen.go +5 -3
- data/tracks/go/exercises/bob/cases_test.go +2 -2
- data/tracks/go/exercises/isbn-verifier/.meta/gen.go +5 -3
- data/tracks/go/exercises/isbn-verifier/cases_test.go +3 -2
- data/tracks/go/exercises/luhn/.meta/gen.go +5 -3
- data/tracks/go/exercises/luhn/cases_test.go +3 -3
- data/tracks/go/exercises/simple-cipher/simple_cipher_test.go +1 -1
- data/tracks/java/config.json +12 -0
- data/tracks/java/exercises/parallel-letter-frequency/.meta/HINTS.md +2 -0
- data/tracks/java/exercises/parallel-letter-frequency/README.md +1 -0
- data/tracks/java/exercises/parallel-letter-frequency/src/test/java/ParallelLetterFrequencyTest.java +1 -38
- data/tracks/java/exercises/rail-fence-cipher/.meta/src/reference/java/RailFenceCipher.java +64 -0
- data/tracks/java/exercises/rail-fence-cipher/README.md +78 -0
- data/tracks/java/exercises/rail-fence-cipher/build.gradle +17 -0
- data/tracks/java/exercises/rail-fence-cipher/src/main/java/.keep +0 -0
- data/tracks/java/exercises/rail-fence-cipher/src/test/java/RailFenceCipherTest.java +55 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/ruby/Gemfile +2 -2
- metadata +7 -3
- data/tracks/ruby/.github/ISSUE_TEMPLATE.md +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77a630fcfa462bfc7fa0f65bb947f2b899102fac
|
4
|
+
data.tar.gz: 0c4d25df70028b4bfcd486fb3841743c031f638e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84d23785bb597fcd2212917cfb1237ae8065a302e8765877fa87f5837f04d54ed3187ba34553463429f2a5207b00b2b8ddd76db76728580f5042bf2b3b415bc5
|
7
|
+
data.tar.gz: 3d1c4fd648179adeffa83eb0acca07a547a807285d93d99a9acf8d0d238b7c6fb25fe2bcd9601fd7a7cdf2dce75264ceec9949dfc7c2e0ac9ab15b73102e4c51
|
data/lib/trackler/version.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"transforming"
|
11
11
|
],
|
12
12
|
"unlocked_by": null,
|
13
|
-
"uuid": "
|
13
|
+
"uuid": "a999c375-f2e2-4d47-a9e2-5af923cd46d1"
|
14
14
|
},
|
15
15
|
{
|
16
16
|
"core": true,
|
@@ -456,4 +456,4 @@
|
|
456
456
|
"bank-account"
|
457
457
|
],
|
458
458
|
"language": "Common Lisp"
|
459
|
-
}
|
459
|
+
}
|
data/tracks/cpp/config.json
CHANGED
@@ -407,7 +407,7 @@
|
|
407
407
|
"strings"
|
408
408
|
],
|
409
409
|
"unlocked_by": null,
|
410
|
-
"uuid": "
|
410
|
+
"uuid": "15c741a0-944d-4b06-a096-6af63137347a"
|
411
411
|
},
|
412
412
|
{
|
413
413
|
"core": false,
|
@@ -418,7 +418,7 @@
|
|
418
418
|
"stacks"
|
419
419
|
],
|
420
420
|
"unlocked_by": null,
|
421
|
-
"uuid": "
|
421
|
+
"uuid": "4a517292-3472-40f2-b4b8-5c8c25219ea5"
|
422
422
|
},
|
423
423
|
{
|
424
424
|
"core": false,
|
@@ -429,11 +429,11 @@
|
|
429
429
|
"strings"
|
430
430
|
],
|
431
431
|
"unlocked_by": null,
|
432
|
-
"uuid": "
|
432
|
+
"uuid": "22ada9c4-a2b5-4a54-83d6-597dc3b90b89"
|
433
433
|
}
|
434
434
|
],
|
435
435
|
"foregone": [
|
436
436
|
"point-mutations"
|
437
437
|
],
|
438
438
|
"language": "C++"
|
439
|
-
}
|
439
|
+
}
|
data/tracks/elixir/config.json
CHANGED
@@ -22,8 +22,10 @@ func main() {
|
|
22
22
|
type js struct {
|
23
23
|
Cases []struct {
|
24
24
|
Description string
|
25
|
-
Input
|
26
|
-
|
25
|
+
Input struct {
|
26
|
+
HeyBob string
|
27
|
+
}
|
28
|
+
Expected string
|
27
29
|
}
|
28
30
|
}
|
29
31
|
|
@@ -39,7 +41,7 @@ var testCases = []struct {
|
|
39
41
|
}{
|
40
42
|
{{range .J.Cases}}{
|
41
43
|
{{printf "%q" .Description}},
|
42
|
-
{{printf "%q" .Input}},
|
44
|
+
{{printf "%q" .Input.HeyBob}},
|
43
45
|
{{printf "%q" .Expected}},
|
44
46
|
},
|
45
47
|
{{end}}}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
package bob
|
2
2
|
|
3
3
|
// Source: exercism/problem-specifications
|
4
|
-
// Commit:
|
5
|
-
// Problem Specifications Version: 1.
|
4
|
+
// Commit: 6dc2014 bob: apply "input" policy
|
5
|
+
// Problem Specifications Version: 1.2.0
|
6
6
|
|
7
7
|
var testCases = []struct {
|
8
8
|
description string
|
@@ -20,8 +20,10 @@ func main() {
|
|
20
20
|
|
21
21
|
type OneCase struct {
|
22
22
|
Description string
|
23
|
-
Input
|
24
|
-
|
23
|
+
Input struct {
|
24
|
+
ISBN string
|
25
|
+
}
|
26
|
+
Expected bool
|
25
27
|
}
|
26
28
|
|
27
29
|
// The JSON structure we expect to be able to unmarshal into
|
@@ -39,6 +41,6 @@ var testCases = []struct {
|
|
39
41
|
expected bool
|
40
42
|
description string
|
41
43
|
}{
|
42
|
-
{{range .J.Cases}}{ "{{.Input}}", {{.Expected}}, "{{.Description}}"},
|
44
|
+
{{range .J.Cases}}{ "{{.Input.ISBN}}", {{.Expected}}, "{{.Description}}"},
|
43
45
|
{{end}}}
|
44
46
|
`
|
@@ -1,8 +1,8 @@
|
|
1
1
|
package isbn
|
2
2
|
|
3
3
|
// Source: exercism/problem-specifications
|
4
|
-
// Commit:
|
5
|
-
// Problem Specifications Version: 2.
|
4
|
+
// Commit: 4288ee0 isbn-verifier: add empty isbn case
|
5
|
+
// Problem Specifications Version: 2.2.0
|
6
6
|
|
7
7
|
var testCases = []struct {
|
8
8
|
isbn string
|
@@ -22,4 +22,5 @@ var testCases = []struct {
|
|
22
22
|
{"3-598-21507", false, "isbn without check digit"},
|
23
23
|
{"3-598-21507-XX", false, "too long isbn"},
|
24
24
|
{"3-598-21515-X", false, "check digit of X should not be used for 0"},
|
25
|
+
{"", false, "empty isbn"},
|
25
26
|
}
|
@@ -22,8 +22,10 @@ func main() {
|
|
22
22
|
type js struct {
|
23
23
|
Cases []struct {
|
24
24
|
Description string
|
25
|
-
Input
|
26
|
-
|
25
|
+
Input struct {
|
26
|
+
Value string
|
27
|
+
}
|
28
|
+
Expected bool
|
27
29
|
}
|
28
30
|
}
|
29
31
|
|
@@ -39,7 +41,7 @@ var testCases = []struct {
|
|
39
41
|
}{
|
40
42
|
{{range .J.Cases}}{
|
41
43
|
{{printf "%q" .Description}},
|
42
|
-
{{printf "%q" .Input}},
|
44
|
+
{{printf "%q" .Input.Value}},
|
43
45
|
{{.Expected}},
|
44
46
|
},
|
45
47
|
{{end}}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
package luhn
|
2
2
|
|
3
3
|
// Source: exercism/problem-specifications
|
4
|
-
// Commit:
|
5
|
-
// Problem Specifications Version: 1.
|
4
|
+
// Commit: e0358d3 luhn: Apply new "input" policy (#1054)
|
5
|
+
// Problem Specifications Version: 1.1.0
|
6
6
|
|
7
7
|
var testCases = []struct {
|
8
8
|
description string
|
@@ -15,7 +15,7 @@ var testCases = []struct {
|
|
15
15
|
false,
|
16
16
|
},
|
17
17
|
{
|
18
|
-
"
|
18
|
+
"a single zero is invalid",
|
19
19
|
"0",
|
20
20
|
false,
|
21
21
|
},
|
@@ -96,7 +96,7 @@ func TestShift(t *testing.T) {
|
|
96
96
|
// invalid shifts
|
97
97
|
for _, s := range []int{-27, -26, 0, 26, 27} {
|
98
98
|
if NewShift(s) != nil {
|
99
|
-
t.
|
99
|
+
t.Fatalf("NewShift(%d) returned non-nil, "+
|
100
100
|
"Want nil return for invalid argument.", s)
|
101
101
|
}
|
102
102
|
}
|
data/tracks/java/config.json
CHANGED
@@ -874,6 +874,18 @@
|
|
874
874
|
"unlocked_by": "bank-account",
|
875
875
|
"uuid": "38a405e8-619d-400f-b53c-2f06461fdf9d"
|
876
876
|
},
|
877
|
+
{
|
878
|
+
"core": false,
|
879
|
+
"difficulty": 6,
|
880
|
+
"slug": "rail-fence-cipher",
|
881
|
+
"topics": [
|
882
|
+
"strings",
|
883
|
+
"loops",
|
884
|
+
"conditionals"
|
885
|
+
],
|
886
|
+
"unlocked_by": "rotational-cipher",
|
887
|
+
"uuid": "6e4ad4ed-cc02-4132-973d-b9163ba0ea3d"
|
888
|
+
},
|
877
889
|
{
|
878
890
|
"core": false,
|
879
891
|
"difficulty": 7,
|
@@ -1,3 +1,5 @@
|
|
1
1
|
Single-threaded (non-concurrent) solutions can pass all tests [but the last.](https://www.youtube.com/watch?v=mJZZNHekEQw) Your solution will be tested for concurrency by submitting it as a [Runnable](https://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html) to an [ExecutorService.](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html) Your solution must leverage multiple [Threads](https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html) to pass the final test.
|
2
2
|
|
3
3
|
Java documentation on [parallel streams](https://docs.oracle.com/javase/tutorial/collections/streams/parallelism.html) may provide some help.
|
4
|
+
|
5
|
+
As a stretch goal, consider if your implementation will work for characters with [diacritics or accents](https://en.wikipedia.org/wiki/Diacritic). For example, such solutions should not consider e and ë the same character. An example text for this case is [Wilhelmus](https://en.wikipedia.org/wiki/Wilhelmus), the Dutch national anthem.
|
@@ -13,6 +13,7 @@ Single-threaded (non-concurrent) solutions can pass all tests [but the last.](ht
|
|
13
13
|
|
14
14
|
Java documentation on [parallel streams](https://docs.oracle.com/javase/tutorial/collections/streams/parallelism.html) may provide some help.
|
15
15
|
|
16
|
+
As a stretch goal, consider if your implementation will work for characters with [diacritics or accents](https://en.wikipedia.org/wiki/Diacritic). For example, such solutions should not consider e and ë the same character. An example text for this case is [Wilhelmus](https://en.wikipedia.org/wiki/Wilhelmus), the Dutch national anthem.
|
16
17
|
|
17
18
|
# Running the tests
|
18
19
|
|
data/tracks/java/exercises/parallel-letter-frequency/src/test/java/ParallelLetterFrequencyTest.java
CHANGED
@@ -8,28 +8,6 @@ import java.util.*;
|
|
8
8
|
|
9
9
|
public class ParallelLetterFrequencyTest {
|
10
10
|
|
11
|
-
// Poem by Friedrich Schiller. The corresponding music is the European Anthem.
|
12
|
-
private String OdeAnDieFreude =
|
13
|
-
"Freude schöner Götterfunken\n" +
|
14
|
-
"Tochter aus Elysium,\n" +
|
15
|
-
"Wir betreten feuertrunken,\n" +
|
16
|
-
"Himmlische, dein Heiligtum!\n" +
|
17
|
-
"Deine Zauber binden wieder\n" +
|
18
|
-
"Was die Mode streng geteilt;\n" +
|
19
|
-
"Alle Menschen werden Brüder,\n" +
|
20
|
-
"Wo dein sanfter Flügel weilt.";
|
21
|
-
|
22
|
-
// Dutch national anthem
|
23
|
-
private String Wilhelmus =
|
24
|
-
"Wilhelmus van Nassouwe\n" +
|
25
|
-
"ben ik, van Duitsen bloed,\n" +
|
26
|
-
"den vaderland getrouwe\n" +
|
27
|
-
"blijf ik tot in den dood.\n" +
|
28
|
-
"Een Prinse van Oranje\n" +
|
29
|
-
"ben ik, vrij, onverveerd,\n" +
|
30
|
-
"den Koning van Hispanje\n" +
|
31
|
-
"heb ik altijd geëerd.";
|
32
|
-
|
33
11
|
// American national anthem
|
34
12
|
private String StarSpangledBanner =
|
35
13
|
"O say can you see by the dawn's early light,\n" +
|
@@ -118,7 +96,7 @@ public class ParallelLetterFrequencyTest {
|
|
118
96
|
@Ignore("Remove to run test")
|
119
97
|
@Test
|
120
98
|
public void punctuationDoesntCount() {
|
121
|
-
ParallelLetterFrequency p = new ParallelLetterFrequency(
|
99
|
+
ParallelLetterFrequency p = new ParallelLetterFrequency(StarSpangledBanner);
|
122
100
|
|
123
101
|
assertFalse(p.letterCounts().containsKey((int) ','));
|
124
102
|
}
|
@@ -131,21 +109,6 @@ public class ParallelLetterFrequencyTest {
|
|
131
109
|
assertFalse(p.letterCounts().containsKey((int) '1'));
|
132
110
|
}
|
133
111
|
|
134
|
-
@Ignore("Remove to run test")
|
135
|
-
@Test
|
136
|
-
public void allThreeAnthemsTogetherProduceCorrectCounts() {
|
137
|
-
StringBuilder b = new StringBuilder();
|
138
|
-
b.append(OdeAnDieFreude);
|
139
|
-
b.append(Wilhelmus);
|
140
|
-
b.append(StarSpangledBanner);
|
141
|
-
|
142
|
-
ParallelLetterFrequency p = new ParallelLetterFrequency(b.toString());
|
143
|
-
|
144
|
-
assertEquals(new Integer(49), p.letterCounts().get((int) 'a'));
|
145
|
-
assertEquals(new Integer(56), p.letterCounts().get((int) 't'));
|
146
|
-
assertEquals(new Integer(2), p.letterCounts().get((int) 'ü'));
|
147
|
-
}
|
148
|
-
|
149
112
|
@Ignore("Remove to run test")
|
150
113
|
@Test
|
151
114
|
public void multipleThreadsGetUsed()
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import java.util.Arrays;
|
2
|
+
|
3
|
+
class RailFenceCipher {
|
4
|
+
|
5
|
+
private int key;
|
6
|
+
|
7
|
+
RailFenceCipher(int key) {
|
8
|
+
this.key = key;
|
9
|
+
}
|
10
|
+
|
11
|
+
String getEncryptedData(String message) {
|
12
|
+
String[] lines = splitIntoLines(message, false);
|
13
|
+
StringBuilder result = new StringBuilder();
|
14
|
+
for (String line : lines) {
|
15
|
+
result.append(line);
|
16
|
+
}
|
17
|
+
return result.toString();
|
18
|
+
}
|
19
|
+
|
20
|
+
String getDecryptedData(String message) {
|
21
|
+
String[] lines = splitIntoLines(message, true);
|
22
|
+
|
23
|
+
int charCount = 0;
|
24
|
+
for (int i = 0; i < key; ++i) {
|
25
|
+
while (lines[i].contains("?")) {
|
26
|
+
String letter = String.valueOf(message.charAt(charCount));
|
27
|
+
lines[i] = lines[i].replaceFirst("\\?", letter);
|
28
|
+
charCount++;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
StringBuilder result = new StringBuilder();
|
33
|
+
int lineCount = 0;
|
34
|
+
int direction = -1;
|
35
|
+
for (int i = 0; i < message.length(); ++i) {
|
36
|
+
String letter = String.valueOf(lines[lineCount].charAt(0));
|
37
|
+
lines[lineCount] = lines[lineCount].substring(1);
|
38
|
+
result.append(letter);
|
39
|
+
direction *= lineCount == 0 || lineCount == key - 1 ? -1 : 1;
|
40
|
+
lineCount += direction;
|
41
|
+
}
|
42
|
+
return result.toString();
|
43
|
+
}
|
44
|
+
|
45
|
+
private String[] splitIntoLines(String message, boolean encrypted) {
|
46
|
+
String[] result = generateEmptyStrings(key);
|
47
|
+
int lineCount = 0;
|
48
|
+
int direction = -1;
|
49
|
+
for (char c : message.toCharArray()) {
|
50
|
+
String letter = String.valueOf(c);
|
51
|
+
result[lineCount] += encrypted ? "?" : letter;
|
52
|
+
direction *= lineCount == 0 || lineCount == key - 1 ? -1 : 1;
|
53
|
+
lineCount += direction;
|
54
|
+
}
|
55
|
+
return result;
|
56
|
+
}
|
57
|
+
|
58
|
+
private String[] generateEmptyStrings(int num) {
|
59
|
+
String[] strings = new String[num];
|
60
|
+
Arrays.fill(strings, "");
|
61
|
+
return strings;
|
62
|
+
}
|
63
|
+
|
64
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# Rail Fence Cipher
|
2
|
+
|
3
|
+
Implement encoding and decoding for the rail fence cipher.
|
4
|
+
|
5
|
+
The Rail Fence cipher is a form of transposition cipher that gets its name from
|
6
|
+
the way in which it's encoded. It was already used by the ancient Greeks.
|
7
|
+
|
8
|
+
In the Rail Fence cipher, the message is written downwards on successive "rails"
|
9
|
+
of an imaginary fence, then moving up when we get to the bottom (like a zig-zag).
|
10
|
+
Finally the message is then read off in rows.
|
11
|
+
|
12
|
+
For example, using three "rails" and the message "WE ARE DISCOVERED FLEE AT ONCE",
|
13
|
+
the cipherer writes out:
|
14
|
+
|
15
|
+
```text
|
16
|
+
W . . . E . . . C . . . R . . . L . . . T . . . E
|
17
|
+
. E . R . D . S . O . E . E . F . E . A . O . C .
|
18
|
+
. . A . . . I . . . V . . . D . . . E . . . N . .
|
19
|
+
```
|
20
|
+
|
21
|
+
Then reads off:
|
22
|
+
|
23
|
+
```text
|
24
|
+
WECRLTEERDSOEEFEAOCAIVDEN
|
25
|
+
```
|
26
|
+
|
27
|
+
To decrypt a message you take the zig-zag shape and fill the ciphertext along the rows.
|
28
|
+
|
29
|
+
```text
|
30
|
+
? . . . ? . . . ? . . . ? . . . ? . . . ? . . . ?
|
31
|
+
. ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? .
|
32
|
+
. . ? . . . ? . . . ? . . . ? . . . ? . . . ? . .
|
33
|
+
```
|
34
|
+
|
35
|
+
The first row has seven spots that can be filled with "WECRLTE".
|
36
|
+
|
37
|
+
```text
|
38
|
+
W . . . E . . . C . . . R . . . L . . . T . . . E
|
39
|
+
. ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? . ? .
|
40
|
+
. . ? . . . ? . . . ? . . . ? . . . ? . . . ? . .
|
41
|
+
```
|
42
|
+
|
43
|
+
Now the 2nd row takes "ERDSOEEFEAOC".
|
44
|
+
|
45
|
+
```text
|
46
|
+
W . . . E . . . C . . . R . . . L . . . T . . . E
|
47
|
+
. E . R . D . S . O . E . E . F . E . A . O . C .
|
48
|
+
. . ? . . . ? . . . ? . . . ? . . . ? . . . ? . .
|
49
|
+
```
|
50
|
+
|
51
|
+
Leaving "AIVDEN" for the last row.
|
52
|
+
|
53
|
+
```text
|
54
|
+
W . . . E . . . C . . . R . . . L . . . T . . . E
|
55
|
+
. E . R . D . S . O . E . E . F . E . A . O . C .
|
56
|
+
. . A . . . I . . . V . . . D . . . E . . . N . .
|
57
|
+
```
|
58
|
+
|
59
|
+
If you now read along the zig-zag shape you can read the original message.
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
To run the tests:
|
64
|
+
|
65
|
+
```sh
|
66
|
+
$ gradle test
|
67
|
+
```
|
68
|
+
|
69
|
+
For more detailed info about the Java track see the [help page](http://exercism.io/languages/java).
|
70
|
+
|
71
|
+
|
72
|
+
## Source
|
73
|
+
|
74
|
+
[Wikipedia](https://en.wikipedia.org/wiki/Transposition_cipher#Rail_Fence_cipher)
|
75
|
+
|
76
|
+
## Submitting Incomplete Solutions
|
77
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
78
|
+
i
|
@@ -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
|
+
}
|
File without changes
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import org.junit.Assert;
|
2
|
+
import org.junit.Ignore;
|
3
|
+
import org.junit.Test;
|
4
|
+
|
5
|
+
public class RailFenceCipherTest {
|
6
|
+
|
7
|
+
private RailFenceCipher railFenceCipher;
|
8
|
+
|
9
|
+
@Test
|
10
|
+
public void encodeWithTwoRails() {
|
11
|
+
railFenceCipher = new RailFenceCipher(2);
|
12
|
+
Assert.assertEquals("XXXXXXXXXOOOOOOOOO",
|
13
|
+
railFenceCipher.getEncryptedData("XOXOXOXOXOXOXOXOXO"));
|
14
|
+
}
|
15
|
+
|
16
|
+
@Ignore("Remove to run test")
|
17
|
+
@Test
|
18
|
+
public void encodeWithThreeRails() {
|
19
|
+
railFenceCipher = new RailFenceCipher(3);
|
20
|
+
Assert.assertEquals("WECRLTEERDSOEEFEAOCAIVDEN",
|
21
|
+
railFenceCipher.getEncryptedData("WEAREDISCOVEREDFLEEATONCE"));
|
22
|
+
}
|
23
|
+
|
24
|
+
@Ignore("Remove to run test")
|
25
|
+
@Test
|
26
|
+
public void encodeWithEndingInTheMiddle() {
|
27
|
+
railFenceCipher = new RailFenceCipher(4);
|
28
|
+
Assert.assertEquals("ESXIEECSR",
|
29
|
+
railFenceCipher.getEncryptedData("EXERCISES"));
|
30
|
+
}
|
31
|
+
|
32
|
+
@Ignore("Remove to run test")
|
33
|
+
@Test
|
34
|
+
public void decodeWithThreeRails() {
|
35
|
+
railFenceCipher = new RailFenceCipher(3);
|
36
|
+
Assert.assertEquals("THEDEVILISINTHEDETAILS",
|
37
|
+
railFenceCipher.getDecryptedData("TEITELHDVLSNHDTISEIIEA"));
|
38
|
+
}
|
39
|
+
|
40
|
+
@Ignore("Remove to run test")
|
41
|
+
@Test
|
42
|
+
public void decodeWithFiveRails() {
|
43
|
+
railFenceCipher = new RailFenceCipher(5);
|
44
|
+
Assert.assertEquals("EXERCISMISAWESOME",
|
45
|
+
railFenceCipher.getDecryptedData("EIEXMSMESAORIWSCE"));
|
46
|
+
}
|
47
|
+
|
48
|
+
@Ignore("Remove to run test")
|
49
|
+
@Test
|
50
|
+
public void decodeWithSixRails() {
|
51
|
+
railFenceCipher = new RailFenceCipher(6);
|
52
|
+
Assert.assertEquals("112358132134558914423337761098715972584418167651094617711286",
|
53
|
+
railFenceCipher.getDecryptedData("133714114238148966225439541018335470986172518171757571896261"));
|
54
|
+
}
|
55
|
+
}
|
data/tracks/ruby/Gemfile
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.1.
|
4
|
+
version: 2.2.1.82
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -7556,6 +7556,11 @@ files:
|
|
7556
7556
|
- tracks/java/exercises/queen-attack/build.gradle
|
7557
7557
|
- tracks/java/exercises/queen-attack/src/main/java/.keep
|
7558
7558
|
- tracks/java/exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java
|
7559
|
+
- tracks/java/exercises/rail-fence-cipher/.meta/src/reference/java/RailFenceCipher.java
|
7560
|
+
- tracks/java/exercises/rail-fence-cipher/README.md
|
7561
|
+
- tracks/java/exercises/rail-fence-cipher/build.gradle
|
7562
|
+
- tracks/java/exercises/rail-fence-cipher/src/main/java/.keep
|
7563
|
+
- tracks/java/exercises/rail-fence-cipher/src/test/java/RailFenceCipherTest.java
|
7559
7564
|
- tracks/java/exercises/raindrops/.meta/src/reference/java/RaindropConverter.java
|
7560
7565
|
- tracks/java/exercises/raindrops/README.md
|
7561
7566
|
- tracks/java/exercises/raindrops/build.gradle
|
@@ -11535,7 +11540,6 @@ files:
|
|
11535
11540
|
- tracks/racket/exercises/word-count/word-count.rkt
|
11536
11541
|
- tracks/racket/img/icon.png
|
11537
11542
|
- tracks/ruby/.git
|
11538
|
-
- tracks/ruby/.github/ISSUE_TEMPLATE.md
|
11539
11543
|
- tracks/ruby/.github/stale.yml
|
11540
11544
|
- tracks/ruby/.gitignore
|
11541
11545
|
- tracks/ruby/.rubocop.yml
|
@@ -1,43 +0,0 @@
|
|
1
|
-
<!--- Provide a general summary of the issue in the Title above -->
|
2
|
-
|
3
|
-
## Expected Behavior
|
4
|
-
<!--- If you're describing a bug, tell us what should happen -->
|
5
|
-
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
6
|
-
|
7
|
-
## Current Behavior
|
8
|
-
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
9
|
-
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
10
|
-
|
11
|
-
## Possible Solution
|
12
|
-
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
13
|
-
<!--- or ideas how to implement the addition or change -->
|
14
|
-
|
15
|
-
## Steps to Reproduce (for bugs)
|
16
|
-
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
17
|
-
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
18
|
-
1.
|
19
|
-
2.
|
20
|
-
3.
|
21
|
-
4.
|
22
|
-
|
23
|
-
## Context
|
24
|
-
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
25
|
-
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
26
|
-
|
27
|
-
## Your Environment
|
28
|
-
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
29
|
-
* Version used:
|
30
|
-
* Environment name and version (e.g. Chrome 39, node.js 5.4):
|
31
|
-
* Operating System and version (desktop or mobile):
|
32
|
-
* Link to your project:
|
33
|
-
|
34
|
-
## Task List
|
35
|
-
|
36
|
-
* [ ] First Task
|
37
|
-
* [ ] Second Task
|
38
|
-
* [ ] Third Task
|
39
|
-
|
40
|
-
## References and Closures
|
41
|
-
|
42
|
-
<!--- references #000 -->
|
43
|
-
<!--- closes #000 -->
|