trackler 2.2.1.84 → 2.2.1.85
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/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/atbash-cipher/canonical-data.json +38 -14
- data/problem-specifications/exercises/bracket-push/canonical-data.json +44 -16
- data/problem-specifications/exercises/change/canonical-data.json +46 -24
- data/problem-specifications/exercises/collatz-conjecture/canonical-data.json +20 -8
- data/problem-specifications/exercises/connect/canonical-data.json +87 -67
- data/problem-specifications/exercises/crypto-square/canonical-data.json +23 -9
- data/problem-specifications/exercises/diamond/canonical-data.json +16 -6
- data/problem-specifications/exercises/difference-of-squares/canonical-data.json +29 -11
- data/problem-specifications/exercises/dominoes/canonical-data.json +37 -13
- data/problem-specifications/exercises/flatten-array/canonical-data.json +19 -7
- data/problem-specifications/exercises/meetup/canonical-data.json +667 -477
- data/tracks/haskell/config.json +9 -0
- data/tracks/haskell/docs/LEARNING.md +3 -3
- data/tracks/haskell/exercises/food-chain/examples/success-standard/src/FoodChain.hs +1 -1
- data/tracks/haskell/exercises/forth/examples/success-standard/src/Forth.hs +2 -2
- data/tracks/haskell/exercises/parallel-letter-frequency/examples/success-standard/src/Frequency.hs +1 -1
- data/tracks/haskell/exercises/sgf-parsing/examples/success-standard/src/Sgf.hs +1 -1
- data/tracks/haskell/exercises/twelve-days/README.md +89 -0
- data/tracks/haskell/exercises/twelve-days/examples/success-standard/package.yaml +16 -0
- data/tracks/haskell/exercises/twelve-days/examples/success-standard/src/TwelveDays.hs +36 -0
- data/tracks/haskell/exercises/twelve-days/package.yaml +20 -0
- data/tracks/haskell/exercises/twelve-days/src/TwelveDays.hs +4 -0
- data/tracks/haskell/exercises/twelve-days/stack.yaml +1 -0
- data/tracks/haskell/exercises/twelve-days/test/Tests.hs +146 -0
- data/tracks/haskell/exercises/zipper/examples/success-standard/src/Zipper.hs +3 -3
- data/tracks/java/exercises/allergies/.meta/version +2 -0
- data/tracks/java/exercises/allergies/src/test/java/AllergiesTest.java +10 -65
- data/tracks/java/exercises/anagram/.meta/version +1 -0
- data/tracks/java/exercises/anagram/src/test/java/AnagramTest.java +36 -35
- data/tracks/java/exercises/atbash-cipher/.meta/version +1 -0
- data/tracks/java/exercises/atbash-cipher/src/test/java/AtbashTest.java +3 -2
- data/tracks/java/exercises/bob/.meta/src/reference/java/Bob.java +3 -0
- data/tracks/java/exercises/bob/.meta/version +1 -0
- data/tracks/java/exercises/bob/src/test/java/BobTest.java +79 -15
- data/tracks/java/exercises/crypto-square/.meta/src/reference/java/CryptoSquare.java +62 -0
- data/tracks/java/exercises/crypto-square/.meta/version +1 -0
- data/tracks/java/exercises/crypto-square/src/test/java/CryptoSquareTest.java +28 -101
- data/tracks/java/exercises/custom-set/.meta/version +1 -1
- data/tracks/java/exercises/custom-set/src/test/java/CustomSetTest.java +8 -0
- data/tracks/java/exercises/forth/.meta/version +1 -1
- data/tracks/java/exercises/forth/src/test/java/ForthEvaluatorTest.java +52 -12
- data/tracks/java/exercises/pascals-triangle/.meta/version +1 -1
- data/tracks/java/exercises/pascals-triangle/src/test/java/PascalsTriangleGeneratorTest.java +48 -0
- data/tracks/java/exercises/prime-factors/.meta/version +1 -0
- data/tracks/java/exercises/prime-factors/src/test/java/PrimeFactorsCalculatorTest.java +2 -6
- data/tracks/java/exercises/protein-translation/.meta/version +1 -1
- data/tracks/java/exercises/roman-numerals/.meta/version +1 -0
- data/tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java +0 -1
- data/tracks/java/exercises/rotational-cipher/.meta/version +1 -0
- data/tracks/java/exercises/rotational-cipher/src/test/java/RotationalCipherTest.java +7 -7
- data/tracks/javascript/.eslintignore +0 -1
- data/tracks/javascript/README.md +1 -1
- data/tracks/javascript/exercises/clock/example.js +8 -11
- metadata +18 -3
- data/tracks/java/exercises/crypto-square/.meta/src/reference/java/Crypto.java +0 -74
|
@@ -1,121 +1,141 @@
|
|
|
1
1
|
{
|
|
2
2
|
"exercise": "connect",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"cases": [
|
|
5
5
|
{
|
|
6
6
|
"description": "an empty board has no winner",
|
|
7
7
|
"property": "winner",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
"input": {
|
|
9
|
+
"board": [
|
|
10
|
+
". . . . .",
|
|
11
|
+
" . . . . .",
|
|
12
|
+
" . . . . .",
|
|
13
|
+
" . . . . .",
|
|
14
|
+
" . . . . ."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
15
17
|
"expected": ""
|
|
16
18
|
},
|
|
17
19
|
{
|
|
18
20
|
"description": "X can win on a 1x1 board",
|
|
19
21
|
"property": "winner",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
22
|
+
"input": {
|
|
23
|
+
"board": [
|
|
24
|
+
"X"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
23
27
|
"expected": "X"
|
|
24
28
|
},
|
|
25
29
|
{
|
|
26
30
|
"description": "O can win on a 1x1 board",
|
|
27
31
|
"property": "winner",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
32
|
+
"input": {
|
|
33
|
+
"board": [
|
|
34
|
+
"O"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
31
37
|
"expected": "O"
|
|
32
38
|
},
|
|
33
39
|
{
|
|
34
40
|
"description": "only edges does not make a winner",
|
|
35
41
|
"property": "winner",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
"input": {
|
|
43
|
+
"board": [
|
|
44
|
+
"O O O X",
|
|
45
|
+
" X . . X",
|
|
46
|
+
" X . . X",
|
|
47
|
+
" X O O O"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
42
50
|
"expected": ""
|
|
43
51
|
},
|
|
44
52
|
{
|
|
45
53
|
"description": "illegal diagonal does not make a winner",
|
|
46
54
|
"property": "winner",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
"input": {
|
|
56
|
+
"board": [
|
|
57
|
+
"X O . .",
|
|
58
|
+
" O X X X",
|
|
59
|
+
" O X O .",
|
|
60
|
+
" . O X .",
|
|
61
|
+
" X X O O"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
54
64
|
"expected": ""
|
|
55
65
|
},
|
|
56
66
|
{
|
|
57
67
|
"description": "nobody wins crossing adjacent angles",
|
|
58
68
|
"property": "winner",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
"input": {
|
|
70
|
+
"board": [
|
|
71
|
+
"X . . .",
|
|
72
|
+
" . X O .",
|
|
73
|
+
" O . X O",
|
|
74
|
+
" . O . X",
|
|
75
|
+
" . . O ."
|
|
76
|
+
]
|
|
77
|
+
},
|
|
66
78
|
"expected": ""
|
|
67
79
|
},
|
|
68
80
|
{
|
|
69
81
|
"description": "X wins crossing from left to right",
|
|
70
82
|
"property": "winner",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
"input": {
|
|
84
|
+
"board": [
|
|
85
|
+
". O . .",
|
|
86
|
+
" O X X X",
|
|
87
|
+
" O X O .",
|
|
88
|
+
" X X O X",
|
|
89
|
+
" . O X ."
|
|
90
|
+
]
|
|
91
|
+
},
|
|
78
92
|
"expected": "X"
|
|
79
93
|
},
|
|
80
94
|
{
|
|
81
95
|
"description": "O wins crossing from top to bottom",
|
|
82
96
|
"property": "winner",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
"input": {
|
|
98
|
+
"board": [
|
|
99
|
+
". O . .",
|
|
100
|
+
" O X X X",
|
|
101
|
+
" O O O .",
|
|
102
|
+
" X X O X",
|
|
103
|
+
" . O X ."
|
|
104
|
+
]
|
|
105
|
+
},
|
|
90
106
|
"expected": "O"
|
|
91
107
|
},
|
|
92
108
|
{
|
|
93
109
|
"description": "X wins using a convoluted path",
|
|
94
110
|
"property": "winner",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
"input": {
|
|
112
|
+
"board": [
|
|
113
|
+
". X X . .",
|
|
114
|
+
" X . X . X",
|
|
115
|
+
" . X . X .",
|
|
116
|
+
" . X X . .",
|
|
117
|
+
" O O O O O"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
102
120
|
"expected": "X"
|
|
103
121
|
},
|
|
104
122
|
{
|
|
105
123
|
"description": "X wins using a spiral path",
|
|
106
124
|
"property": "winner",
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
125
|
+
"input": {
|
|
126
|
+
"board": [
|
|
127
|
+
"O X X X X X X X X",
|
|
128
|
+
" O X O O O O O O O",
|
|
129
|
+
" O X O X X X X X O",
|
|
130
|
+
" O X O X O O O X O",
|
|
131
|
+
" O X O X X X O X O",
|
|
132
|
+
" O X O O O X O X O",
|
|
133
|
+
" O X X X X X O X O",
|
|
134
|
+
" O O O O O O O X O",
|
|
135
|
+
" X X X X X X X X O"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
118
138
|
"expected": "X"
|
|
119
139
|
}
|
|
120
140
|
]
|
|
121
|
-
}
|
|
141
|
+
}
|
|
@@ -1,48 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"exercise": "crypto-square",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"cases": [
|
|
5
5
|
{
|
|
6
6
|
"description": "empty plaintext results in an empty ciphertext",
|
|
7
7
|
"property": "ciphertext",
|
|
8
|
-
"
|
|
8
|
+
"input": {
|
|
9
|
+
"plaintext": ""
|
|
10
|
+
},
|
|
9
11
|
"expected": ""
|
|
10
12
|
},
|
|
11
13
|
{
|
|
12
14
|
"description": "Lowercase",
|
|
13
15
|
"property": "ciphertext",
|
|
14
|
-
"
|
|
16
|
+
"input": {
|
|
17
|
+
"plaintext": "A"
|
|
18
|
+
},
|
|
15
19
|
"expected": "a"
|
|
16
20
|
},
|
|
17
21
|
{
|
|
18
22
|
"description": "Remove spaces",
|
|
19
23
|
"property": "ciphertext",
|
|
20
|
-
"
|
|
24
|
+
"input": {
|
|
25
|
+
"plaintext": " b "
|
|
26
|
+
},
|
|
21
27
|
"expected": "b"
|
|
22
28
|
},
|
|
23
29
|
{
|
|
24
30
|
"description": "Remove punctuation",
|
|
25
31
|
"property": "ciphertext",
|
|
26
|
-
"
|
|
32
|
+
"input": {
|
|
33
|
+
"plaintext": "@1,%!"
|
|
34
|
+
},
|
|
27
35
|
"expected": "1"
|
|
28
36
|
},
|
|
29
37
|
{
|
|
30
38
|
"description": "9 character plaintext results in 3 chunks of 3 characters",
|
|
31
39
|
"property": "ciphertext",
|
|
32
|
-
"
|
|
40
|
+
"input": {
|
|
41
|
+
"plaintext": "This is fun!"
|
|
42
|
+
},
|
|
33
43
|
"expected": "tsf hiu isn"
|
|
34
44
|
},
|
|
35
45
|
{
|
|
36
46
|
"description": "8 character plaintext results in 3 chunks, the last one with a trailing space",
|
|
37
47
|
"property": "ciphertext",
|
|
38
|
-
"
|
|
48
|
+
"input": {
|
|
49
|
+
"plaintext": "Chill out."
|
|
50
|
+
},
|
|
39
51
|
"expected": "clu hlt io "
|
|
40
52
|
},
|
|
41
53
|
{
|
|
42
54
|
"description": "54 character plaintext results in 7 chunks, the last two with trailing spaces",
|
|
43
55
|
"property": "ciphertext",
|
|
44
|
-
"
|
|
56
|
+
"input": {
|
|
57
|
+
"plaintext": "If man was meant to stay on the ground, god would have given us roots."
|
|
58
|
+
},
|
|
45
59
|
"expected": "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau "
|
|
46
60
|
}
|
|
47
61
|
]
|
|
48
|
-
}
|
|
62
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"exercise": "diamond",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"comments": [
|
|
5
5
|
" The tests contained within this canonical data file are suitable ",
|
|
6
6
|
" for value-based testing, in which each test case checks that the ",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
{
|
|
23
23
|
"description": "Degenerate case with a single 'A' row",
|
|
24
24
|
"property": "rows",
|
|
25
|
-
"input":
|
|
25
|
+
"input": {
|
|
26
|
+
"letter": "A"
|
|
27
|
+
},
|
|
26
28
|
"expected": [
|
|
27
29
|
"A"
|
|
28
30
|
]
|
|
@@ -30,7 +32,9 @@
|
|
|
30
32
|
{
|
|
31
33
|
"description": "Degenerate case with no row containing 3 distinct groups of spaces",
|
|
32
34
|
"property": "rows",
|
|
33
|
-
"input":
|
|
35
|
+
"input": {
|
|
36
|
+
"letter": "B"
|
|
37
|
+
},
|
|
34
38
|
"expected": [
|
|
35
39
|
" A ",
|
|
36
40
|
"B B",
|
|
@@ -40,7 +44,9 @@
|
|
|
40
44
|
{
|
|
41
45
|
"description": "Smallest non-degenerate case with odd diamond side length",
|
|
42
46
|
"property": "rows",
|
|
43
|
-
"input":
|
|
47
|
+
"input": {
|
|
48
|
+
"letter": "C"
|
|
49
|
+
},
|
|
44
50
|
"expected": [
|
|
45
51
|
" A ",
|
|
46
52
|
" B B ",
|
|
@@ -52,7 +58,9 @@
|
|
|
52
58
|
{
|
|
53
59
|
"description": "Smallest non-degenerate case with even diamond side length",
|
|
54
60
|
"property": "rows",
|
|
55
|
-
"input":
|
|
61
|
+
"input": {
|
|
62
|
+
"letter": "D"
|
|
63
|
+
},
|
|
56
64
|
"expected": [
|
|
57
65
|
" A ",
|
|
58
66
|
" B B ",
|
|
@@ -66,7 +74,9 @@
|
|
|
66
74
|
{
|
|
67
75
|
"description": "Largest possible diamond",
|
|
68
76
|
"property": "rows",
|
|
69
|
-
"input":
|
|
77
|
+
"input": {
|
|
78
|
+
"letter": "Z"
|
|
79
|
+
},
|
|
70
80
|
"expected": [
|
|
71
81
|
" A ",
|
|
72
82
|
" B B ",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"exercise": "difference-of-squares",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"cases": [
|
|
5
5
|
{
|
|
6
6
|
"description": "Square the sum of the numbers up to the given number",
|
|
@@ -8,19 +8,25 @@
|
|
|
8
8
|
{
|
|
9
9
|
"description": "square of sum 1",
|
|
10
10
|
"property": "squareOfSum",
|
|
11
|
-
"
|
|
11
|
+
"input": {
|
|
12
|
+
"number": 1
|
|
13
|
+
},
|
|
12
14
|
"expected": 1
|
|
13
15
|
},
|
|
14
16
|
{
|
|
15
17
|
"description": "square of sum 5",
|
|
16
18
|
"property": "squareOfSum",
|
|
17
|
-
"
|
|
19
|
+
"input": {
|
|
20
|
+
"number": 5
|
|
21
|
+
},
|
|
18
22
|
"expected": 225
|
|
19
23
|
},
|
|
20
24
|
{
|
|
21
25
|
"description": "square of sum 100",
|
|
22
26
|
"property": "squareOfSum",
|
|
23
|
-
"
|
|
27
|
+
"input": {
|
|
28
|
+
"number": 100
|
|
29
|
+
},
|
|
24
30
|
"expected": 25502500
|
|
25
31
|
}
|
|
26
32
|
]
|
|
@@ -31,19 +37,25 @@
|
|
|
31
37
|
{
|
|
32
38
|
"description": "sum of squares 1",
|
|
33
39
|
"property": "sumOfSquares",
|
|
34
|
-
"
|
|
40
|
+
"input": {
|
|
41
|
+
"number": 1
|
|
42
|
+
},
|
|
35
43
|
"expected": 1
|
|
36
44
|
},
|
|
37
45
|
{
|
|
38
46
|
"description": "sum of squares 5",
|
|
39
47
|
"property": "sumOfSquares",
|
|
40
|
-
"
|
|
48
|
+
"input": {
|
|
49
|
+
"number": 5
|
|
50
|
+
},
|
|
41
51
|
"expected": 55
|
|
42
52
|
},
|
|
43
53
|
{
|
|
44
54
|
"description": "sum of squares 100",
|
|
45
55
|
"property": "sumOfSquares",
|
|
46
|
-
"
|
|
56
|
+
"input": {
|
|
57
|
+
"number": 100
|
|
58
|
+
},
|
|
47
59
|
"expected": 338350
|
|
48
60
|
}
|
|
49
61
|
]
|
|
@@ -54,22 +66,28 @@
|
|
|
54
66
|
{
|
|
55
67
|
"description": "difference of squares 1",
|
|
56
68
|
"property": "differenceOfSquares",
|
|
57
|
-
"
|
|
69
|
+
"input": {
|
|
70
|
+
"number": 1
|
|
71
|
+
},
|
|
58
72
|
"expected": 0
|
|
59
73
|
},
|
|
60
74
|
{
|
|
61
75
|
"description": "difference of squares 5",
|
|
62
76
|
"property": "differenceOfSquares",
|
|
63
|
-
"
|
|
77
|
+
"input": {
|
|
78
|
+
"number": 5
|
|
79
|
+
},
|
|
64
80
|
"expected": 170
|
|
65
81
|
},
|
|
66
82
|
{
|
|
67
83
|
"description": "difference of squares 100",
|
|
68
84
|
"property": "differenceOfSquares",
|
|
69
|
-
"
|
|
85
|
+
"input": {
|
|
86
|
+
"number": 100
|
|
87
|
+
},
|
|
70
88
|
"expected": 25164150
|
|
71
89
|
}
|
|
72
90
|
]
|
|
73
91
|
}
|
|
74
92
|
]
|
|
75
|
-
}
|
|
93
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"exercise": "dominoes",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"comments": [
|
|
5
5
|
"Inputs are given as lists of two-element lists.",
|
|
6
6
|
"Feel free to convert the input to a sensible type in the specific language",
|
|
@@ -40,37 +40,49 @@
|
|
|
40
40
|
{
|
|
41
41
|
"description": "empty input = empty output",
|
|
42
42
|
"property": "canChain",
|
|
43
|
-
"input":
|
|
43
|
+
"input": {
|
|
44
|
+
"dominoes": []
|
|
45
|
+
},
|
|
44
46
|
"expected": true
|
|
45
47
|
},
|
|
46
48
|
{
|
|
47
49
|
"description": "singleton input = singleton output",
|
|
48
50
|
"property": "canChain",
|
|
49
|
-
"input":
|
|
51
|
+
"input": {
|
|
52
|
+
"dominoes": [[1, 1]]
|
|
53
|
+
},
|
|
50
54
|
"expected": true
|
|
51
55
|
},
|
|
52
56
|
{
|
|
53
57
|
"description": "singleton that can't be chained",
|
|
54
58
|
"property": "canChain",
|
|
55
|
-
"input":
|
|
59
|
+
"input": {
|
|
60
|
+
"dominoes": [[1, 2]]
|
|
61
|
+
},
|
|
56
62
|
"expected": false
|
|
57
63
|
},
|
|
58
64
|
{
|
|
59
65
|
"description": "three elements",
|
|
60
66
|
"property": "canChain",
|
|
61
|
-
"input":
|
|
67
|
+
"input": {
|
|
68
|
+
"dominoes": [[1, 2], [3, 1], [2, 3]]
|
|
69
|
+
},
|
|
62
70
|
"expected": true
|
|
63
71
|
},
|
|
64
72
|
{
|
|
65
73
|
"description": "can reverse dominoes",
|
|
66
74
|
"property": "canChain",
|
|
67
|
-
"input":
|
|
75
|
+
"input": {
|
|
76
|
+
"dominoes": [[1, 2], [1, 3], [2, 3]]
|
|
77
|
+
},
|
|
68
78
|
"expected": true
|
|
69
79
|
},
|
|
70
80
|
{
|
|
71
81
|
"description": "can't be chained",
|
|
72
82
|
"property": "canChain",
|
|
73
|
-
"input":
|
|
83
|
+
"input": {
|
|
84
|
+
"dominoes": [[1, 2], [4, 1], [2, 3]]
|
|
85
|
+
},
|
|
74
86
|
"expected": false
|
|
75
87
|
},
|
|
76
88
|
{
|
|
@@ -83,19 +95,25 @@
|
|
|
83
95
|
"as that is not a sufficient condition."
|
|
84
96
|
],
|
|
85
97
|
"property": "canChain",
|
|
86
|
-
"input":
|
|
98
|
+
"input": {
|
|
99
|
+
"dominoes": [[1, 1], [2, 2]]
|
|
100
|
+
},
|
|
87
101
|
"expected": false
|
|
88
102
|
},
|
|
89
103
|
{
|
|
90
104
|
"description": "disconnected - double loop",
|
|
91
105
|
"property": "canChain",
|
|
92
|
-
"input":
|
|
106
|
+
"input": {
|
|
107
|
+
"dominoes": [[1, 2], [2, 1], [3, 4], [4, 3]]
|
|
108
|
+
},
|
|
93
109
|
"expected": false
|
|
94
110
|
},
|
|
95
111
|
{
|
|
96
112
|
"description": "disconnected - single isolated",
|
|
97
113
|
"property": "canChain",
|
|
98
|
-
"input":
|
|
114
|
+
"input": {
|
|
115
|
+
"dominoes": [[1, 2], [2, 3], [3, 1], [4, 4]]
|
|
116
|
+
},
|
|
99
117
|
"expected": false
|
|
100
118
|
},
|
|
101
119
|
{
|
|
@@ -108,19 +126,25 @@
|
|
|
108
126
|
"You need to place the (2, 4) after the (1, 2) rather than the (2, 3)."
|
|
109
127
|
],
|
|
110
128
|
"property": "canChain",
|
|
111
|
-
"input":
|
|
129
|
+
"input": {
|
|
130
|
+
"dominoes": [[1, 2], [2, 3], [3, 1], [2, 4], [2, 4]]
|
|
131
|
+
},
|
|
112
132
|
"expected": true
|
|
113
133
|
},
|
|
114
134
|
{
|
|
115
135
|
"description": "separate loops",
|
|
116
136
|
"property": "canChain",
|
|
117
|
-
"input":
|
|
137
|
+
"input": {
|
|
138
|
+
"dominoes": [[1, 2], [2, 3], [3, 1], [1, 1], [2, 2], [3, 3]]
|
|
139
|
+
},
|
|
118
140
|
"expected": true
|
|
119
141
|
},
|
|
120
142
|
{
|
|
121
143
|
"description": "nine elements",
|
|
122
144
|
"property": "canChain",
|
|
123
|
-
"input":
|
|
145
|
+
"input": {
|
|
146
|
+
"dominoes": [[1, 2], [5, 3], [3, 1], [1, 2], [2, 4], [1, 6], [2, 3], [3, 4], [5, 6]]
|
|
147
|
+
},
|
|
124
148
|
"expected": true
|
|
125
149
|
}
|
|
126
150
|
]
|