trackler 2.2.1.88 → 2.2.1.89
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/bowling/canonical-data.json +95 -39
- data/problem-specifications/exercises/gigasecond/canonical-data.json +17 -7
- data/problem-specifications/exercises/pangram/canonical-data.json +32 -12
- data/problem-specifications/exercises/say/canonical-data.json +47 -17
- data/problem-specifications/exercises/sum-of-multiples/canonical-data.json +54 -28
- data/problem-specifications/exercises/triangle/canonical-data.json +52 -18
- data/problem-specifications/exercises/two-bucket/canonical-data.json +38 -26
- data/problem-specifications/exercises/two-fer/canonical-data.json +14 -8
- data/problem-specifications/exercises/word-count/canonical-data.json +35 -13
- data/problem-specifications/exercises/wordy/canonical-data.json +50 -18
- data/tracks/bash/exercises/leap/.meta/version +1 -0
- data/tracks/bash/exercises/leap/example.sh +9 -9
- data/tracks/bash/exercises/leap/leap_test.sh +17 -33
- data/tracks/ceylon/exercises/anagram/source/anagram/AnagramTest.ceylon +1 -1
- data/tracks/ceylon/exercises/bracket-push/source/bracketpush/BracketsTest.ceylon +1 -1
- data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon +2 -1
- data/tracks/fsharp/build.cake +2 -7
- data/tracks/fsharp/exercises/acronym/AcronymTest.fs +1 -1
- data/tracks/fsharp/exercises/all-your-base/AllYourBase.fs +1 -1
- data/tracks/fsharp/exercises/all-your-base/AllYourBaseTest.fs +43 -43
- data/tracks/fsharp/exercises/all-your-base/Example.fs +5 -5
- data/tracks/fsharp/exercises/allergies/AllergiesTest.fs +1 -1
- data/tracks/fsharp/exercises/alphametics/AlphameticsTest.fs +19 -1
- data/tracks/fsharp/exercises/alphametics/Example.fs +53 -34
- data/tracks/fsharp/exercises/anagram/AnagramTest.fs +1 -1
- data/tracks/fsharp/exercises/atbash-cipher/AtbashCipherTest.fs +1 -1
- data/tracks/fsharp/exercises/beer-song/BeerSongTest.fs +1 -1
- data/tracks/fsharp/exercises/binary-search/BinarySearchTest.fs +1 -1
- data/tracks/fsharp/exercises/bob/BobTest.fs +1 -1
- data/tracks/fsharp/exercises/book-store/BookStoreTest.fs +1 -1
- data/tracks/fsharp/exercises/bracket-push/BracketPushTest.fs +1 -1
- data/tracks/fsharp/exercises/change/ChangeTest.fs +1 -1
- data/tracks/fsharp/exercises/collatz-conjecture/CollatzConjectureTest.fs +1 -1
- data/tracks/fsharp/exercises/connect/ConnectTest.fs +1 -1
- data/tracks/fsharp/exercises/crypto-square/CryptoSquareTest.fs +1 -1
- data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquaresTest.fs +1 -1
- data/tracks/fsharp/exercises/dominoes/DominoesTest.fs +25 -25
- data/tracks/fsharp/exercises/etl/EtlTest.fs +8 -8
- data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifierTest.fs +5 -1
- data/tracks/fsharp/exercises/luhn/LuhnTest.fs +1 -1
- data/tracks/fsharp/exercises/meetup/Example.fs +11 -11
- data/tracks/fsharp/exercises/meetup/Meetup.fs +2 -2
- data/tracks/fsharp/exercises/meetup/MeetupTest.fs +96 -96
- data/tracks/fsharp/exercises/robot-simulator/Example.fs +21 -21
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulator.fs +5 -5
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs +78 -96
- data/tracks/fsharp/generators/CanonicalData.fs +50 -4
- data/tracks/fsharp/generators/Common.fs +4 -13
- data/tracks/fsharp/generators/Exercise.fs +31 -15
- data/tracks/fsharp/generators/Generators.fs +76 -111
- data/tracks/haskell/exercises/alphametics/package.yaml +1 -1
- data/tracks/haskell/exercises/alphametics/test/Tests.hs +5 -0
- data/tracks/haskell/exercises/bowling/package.yaml +1 -1
- data/tracks/haskell/exercises/pangram/package.yaml +1 -1
- data/tracks/haskell/exercises/say/package.yaml +1 -1
- data/tracks/haskell/exercises/sum-of-multiples/package.yaml +1 -1
- data/tracks/haskell/exercises/word-count/package.yaml +1 -1
- data/tracks/haskell/exercises/wordy/package.yaml +1 -1
- data/tracks/java/exercises/nucleotide-count/.meta/hints.md +58 -0
- data/tracks/java/exercises/nucleotide-count/README.md +62 -0
- metadata +4 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"exercise": "word-count",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"comments": [
|
|
5
5
|
"For each word in the input, count the number of times it appears in the",
|
|
6
6
|
"entire sentence."
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
{
|
|
10
10
|
"description": "count one word",
|
|
11
11
|
"property": "countwords",
|
|
12
|
-
"input":
|
|
12
|
+
"input": {
|
|
13
|
+
"sentence": "word"
|
|
14
|
+
},
|
|
13
15
|
"expected": {
|
|
14
16
|
"word": 1
|
|
15
17
|
}
|
|
@@ -17,7 +19,9 @@
|
|
|
17
19
|
{
|
|
18
20
|
"description": "count one of each word",
|
|
19
21
|
"property": "countwords",
|
|
20
|
-
"input":
|
|
22
|
+
"input": {
|
|
23
|
+
"sentence": "one of each"
|
|
24
|
+
},
|
|
21
25
|
"expected": {
|
|
22
26
|
"one": 1,
|
|
23
27
|
"of": 1,
|
|
@@ -27,7 +31,9 @@
|
|
|
27
31
|
{
|
|
28
32
|
"description": "multiple occurrences of a word",
|
|
29
33
|
"property": "countwords",
|
|
30
|
-
"input":
|
|
34
|
+
"input": {
|
|
35
|
+
"sentence": "one fish two fish red fish blue fish"
|
|
36
|
+
},
|
|
31
37
|
"expected": {
|
|
32
38
|
"one": 1,
|
|
33
39
|
"fish": 4,
|
|
@@ -39,7 +45,9 @@
|
|
|
39
45
|
{
|
|
40
46
|
"description": "handles cramped lists",
|
|
41
47
|
"property": "countwords",
|
|
42
|
-
"input":
|
|
48
|
+
"input": {
|
|
49
|
+
"sentence": "one,two,three"
|
|
50
|
+
},
|
|
43
51
|
"expected": {
|
|
44
52
|
"one": 1,
|
|
45
53
|
"two": 1,
|
|
@@ -49,7 +57,9 @@
|
|
|
49
57
|
{
|
|
50
58
|
"description": "handles expanded lists",
|
|
51
59
|
"property": "countwords",
|
|
52
|
-
"input":
|
|
60
|
+
"input": {
|
|
61
|
+
"sentence": "one,\ntwo,\nthree"
|
|
62
|
+
},
|
|
53
63
|
"expected": {
|
|
54
64
|
"one": 1,
|
|
55
65
|
"two": 1,
|
|
@@ -59,7 +69,9 @@
|
|
|
59
69
|
{
|
|
60
70
|
"description": "ignore punctuation",
|
|
61
71
|
"property": "countwords",
|
|
62
|
-
"input":
|
|
72
|
+
"input": {
|
|
73
|
+
"sentence": "car: carpet as java: javascript!!&@$%^&"
|
|
74
|
+
},
|
|
63
75
|
"expected": {
|
|
64
76
|
"car": 1,
|
|
65
77
|
"carpet": 1,
|
|
@@ -71,7 +83,9 @@
|
|
|
71
83
|
{
|
|
72
84
|
"description": "include numbers",
|
|
73
85
|
"property": "countwords",
|
|
74
|
-
"input":
|
|
86
|
+
"input": {
|
|
87
|
+
"sentence": "testing, 1, 2 testing"
|
|
88
|
+
},
|
|
75
89
|
"expected": {
|
|
76
90
|
"testing": 2,
|
|
77
91
|
"1": 1,
|
|
@@ -81,7 +95,9 @@
|
|
|
81
95
|
{
|
|
82
96
|
"description": "normalize case",
|
|
83
97
|
"property": "countwords",
|
|
84
|
-
"input":
|
|
98
|
+
"input": {
|
|
99
|
+
"sentence": "go Go GO Stop stop"
|
|
100
|
+
},
|
|
85
101
|
"expected": {
|
|
86
102
|
"go": 3,
|
|
87
103
|
"stop": 2
|
|
@@ -90,7 +106,9 @@
|
|
|
90
106
|
{
|
|
91
107
|
"description": "with apostrophes",
|
|
92
108
|
"property": "countwords",
|
|
93
|
-
"input":
|
|
109
|
+
"input": {
|
|
110
|
+
"sentence": "First: don't laugh. Then: don't cry."
|
|
111
|
+
},
|
|
94
112
|
"expected": {
|
|
95
113
|
"first": 1,
|
|
96
114
|
"don't": 2,
|
|
@@ -102,7 +120,9 @@
|
|
|
102
120
|
{
|
|
103
121
|
"description": "with quotations",
|
|
104
122
|
"property": "countwords",
|
|
105
|
-
"input":
|
|
123
|
+
"input": {
|
|
124
|
+
"sentence": "Joe can't tell between 'large' and large."
|
|
125
|
+
},
|
|
106
126
|
"expected": {
|
|
107
127
|
"joe": 1,
|
|
108
128
|
"can't": 1,
|
|
@@ -115,11 +135,13 @@
|
|
|
115
135
|
{
|
|
116
136
|
"description": "multiple spaces not detected as a word",
|
|
117
137
|
"property": "countwords",
|
|
118
|
-
"input":
|
|
138
|
+
"input": {
|
|
139
|
+
"sentence": " multiple whitespaces"
|
|
140
|
+
},
|
|
119
141
|
"expected": {
|
|
120
142
|
"multiple": 1,
|
|
121
143
|
"whitespaces": 1
|
|
122
144
|
}
|
|
123
145
|
}
|
|
124
146
|
]
|
|
125
|
-
}
|
|
147
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"exercise": "wordy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"comments": [
|
|
5
5
|
"The tests that expect 'false' should be implemented to raise",
|
|
6
6
|
"an error, or indicate a failure. Implement this in a way that",
|
|
@@ -10,98 +10,130 @@
|
|
|
10
10
|
{
|
|
11
11
|
"description": "addition",
|
|
12
12
|
"property": "answer",
|
|
13
|
-
"input":
|
|
13
|
+
"input": {
|
|
14
|
+
"question": "What is 1 plus 1?"
|
|
15
|
+
},
|
|
14
16
|
"expected": 2
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
"description": "more addition",
|
|
18
20
|
"property": "answer",
|
|
19
|
-
"input":
|
|
21
|
+
"input": {
|
|
22
|
+
"question": "What is 53 plus 2?"
|
|
23
|
+
},
|
|
20
24
|
"expected": 55
|
|
21
25
|
},
|
|
22
26
|
{
|
|
23
27
|
"description": "addition with negative numbers",
|
|
24
28
|
"property": "answer",
|
|
25
|
-
"input":
|
|
29
|
+
"input": {
|
|
30
|
+
"question": "What is -1 plus -10?"
|
|
31
|
+
},
|
|
26
32
|
"expected": -11
|
|
27
33
|
},
|
|
28
34
|
{
|
|
29
35
|
"description": "large addition",
|
|
30
36
|
"property": "answer",
|
|
31
|
-
"input":
|
|
37
|
+
"input": {
|
|
38
|
+
"question": "What is 123 plus 45678?"
|
|
39
|
+
},
|
|
32
40
|
"expected": 45801
|
|
33
41
|
},
|
|
34
42
|
{
|
|
35
43
|
"description": "subtraction",
|
|
36
44
|
"property": "answer",
|
|
37
|
-
"input":
|
|
45
|
+
"input": {
|
|
46
|
+
"question": "What is 4 minus -12?"
|
|
47
|
+
},
|
|
38
48
|
"expected": 16
|
|
39
49
|
},
|
|
40
50
|
{
|
|
41
51
|
"description": "multiplication",
|
|
42
52
|
"property": "answer",
|
|
43
|
-
"input":
|
|
53
|
+
"input": {
|
|
54
|
+
"question": "What is -3 multiplied by 25?"
|
|
55
|
+
},
|
|
44
56
|
"expected": -75
|
|
45
57
|
},
|
|
46
58
|
{
|
|
47
59
|
"description": "division",
|
|
48
60
|
"property": "answer",
|
|
49
|
-
"input":
|
|
61
|
+
"input": {
|
|
62
|
+
"question": "What is 33 divided by -3?"
|
|
63
|
+
},
|
|
50
64
|
"expected": -11
|
|
51
65
|
},
|
|
52
66
|
{
|
|
53
67
|
"description": "multiple additions",
|
|
54
68
|
"property": "answer",
|
|
55
|
-
"input":
|
|
69
|
+
"input": {
|
|
70
|
+
"question": "What is 1 plus 1 plus 1?"
|
|
71
|
+
},
|
|
56
72
|
"expected": 3
|
|
57
73
|
},
|
|
58
74
|
{
|
|
59
75
|
"description": "addition and subtraction",
|
|
60
76
|
"property": "answer",
|
|
61
|
-
"input":
|
|
77
|
+
"input": {
|
|
78
|
+
"question": "What is 1 plus 5 minus -2?"
|
|
79
|
+
},
|
|
62
80
|
"expected": 8
|
|
63
81
|
},
|
|
64
82
|
{
|
|
65
83
|
"description": "multiple subtraction",
|
|
66
84
|
"property": "answer",
|
|
67
|
-
"input":
|
|
85
|
+
"input": {
|
|
86
|
+
"question": "What is 20 minus 4 minus 13?"
|
|
87
|
+
},
|
|
68
88
|
"expected": 3
|
|
69
89
|
},
|
|
70
90
|
{
|
|
71
91
|
"description": "subtraction then addition",
|
|
72
92
|
"property": "answer",
|
|
73
|
-
"input":
|
|
93
|
+
"input": {
|
|
94
|
+
"question": "What is 17 minus 6 plus 3?"
|
|
95
|
+
},
|
|
74
96
|
"expected": 14
|
|
75
97
|
},
|
|
76
98
|
{
|
|
77
99
|
"description": "multiple multiplication",
|
|
78
100
|
"property": "answer",
|
|
79
|
-
"input":
|
|
101
|
+
"input": {
|
|
102
|
+
"question": "What is 2 multiplied by -2 multiplied by 3?"
|
|
103
|
+
},
|
|
80
104
|
"expected": -12
|
|
81
105
|
},
|
|
82
106
|
{
|
|
83
107
|
"description": "addition and multiplication",
|
|
84
108
|
"property": "answer",
|
|
85
|
-
"input":
|
|
109
|
+
"input": {
|
|
110
|
+
"question": "What is -3 plus 7 multiplied by -2?"
|
|
111
|
+
},
|
|
86
112
|
"expected": -8
|
|
87
113
|
},
|
|
88
114
|
{
|
|
89
115
|
"description": "multiple division",
|
|
90
116
|
"property": "answer",
|
|
91
|
-
"input":
|
|
117
|
+
"input": {
|
|
118
|
+
"question": "What is -12 divided by 2 divided by -3?"
|
|
119
|
+
},
|
|
92
120
|
"expected": 2
|
|
93
121
|
},
|
|
94
122
|
{
|
|
95
123
|
"description": "unknown operation",
|
|
96
124
|
"property": "answer",
|
|
97
|
-
"input":
|
|
125
|
+
"input": {
|
|
126
|
+
"question": "What is 52 cubed?"
|
|
127
|
+
},
|
|
98
128
|
"expected": false
|
|
99
129
|
},
|
|
100
130
|
{
|
|
101
131
|
"description": "Non math question",
|
|
102
132
|
"property": "answer",
|
|
103
|
-
"input":
|
|
133
|
+
"input": {
|
|
134
|
+
"question": "Who is the President of the United States?"
|
|
135
|
+
},
|
|
104
136
|
"expected": false
|
|
105
137
|
}
|
|
106
138
|
]
|
|
107
|
-
}
|
|
139
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.2.0
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
usage() {
|
|
4
4
|
echo "Usage: leap.sh <year>" >&2
|
|
5
5
|
exit 1
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
if [ "$#" != 1 ]; then
|
|
8
|
+
# Check number of params
|
|
9
|
+
if [[ "$#" != 1 ]]; then
|
|
10
10
|
usage
|
|
11
11
|
fi
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# Check if param is an integer
|
|
14
14
|
if ! [[ $1 =~ ^[0-9]+$ ]]; then
|
|
15
15
|
usage
|
|
16
16
|
fi
|
|
17
17
|
|
|
18
|
-
if [ $(($1 % 4)) == 0 ] \
|
|
19
|
-
&& [ $(($1 % 100)) != 0 ] \
|
|
20
|
-
|| [ $(($1 % 400)) == 0 ]; then
|
|
21
|
-
echo "
|
|
18
|
+
if [[ $(($1 % 4)) == 0 ]] \
|
|
19
|
+
&& [[ $(($1 % 100)) != 0 ]] \
|
|
20
|
+
|| [[ $(($1 % 400)) == 0 ]]; then
|
|
21
|
+
echo "true"
|
|
22
22
|
else
|
|
23
|
-
echo "
|
|
23
|
+
echo "false"
|
|
24
24
|
fi
|
|
@@ -1,51 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env bats
|
|
2
2
|
|
|
3
|
-
@test
|
|
3
|
+
@test 'year not divisible by 4: common year' {
|
|
4
4
|
#skip
|
|
5
|
-
run ./leap.sh
|
|
6
|
-
|
|
7
|
-
[ "$status" -eq 0 ]
|
|
8
|
-
[ "$output" = "This is a leap year." ]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@test 'Non-leap year should return non-leap year' {
|
|
12
|
-
skip
|
|
13
|
-
run ./leap.sh 1997
|
|
5
|
+
run ./leap.sh 2015
|
|
14
6
|
|
|
15
7
|
[ "$status" -eq 0 ]
|
|
16
|
-
[ "$output" =
|
|
8
|
+
[ "$output" = 'false' ]
|
|
17
9
|
}
|
|
18
10
|
|
|
19
|
-
@test '
|
|
11
|
+
@test 'year divisible by 4, not divisible by 100: leap year' {
|
|
20
12
|
skip
|
|
21
|
-
run ./leap.sh
|
|
22
|
-
|
|
23
|
-
[ "$status" -eq 0 ]
|
|
24
|
-
[ "$output" = "This is not a leap year." ]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@test 'Century non-leap year should return non-leap year' {
|
|
28
|
-
skip
|
|
29
|
-
run ./leap.sh 1900
|
|
13
|
+
run ./leap.sh 1996
|
|
30
14
|
|
|
31
15
|
[ "$status" -eq 0 ]
|
|
32
|
-
[ "$output" =
|
|
16
|
+
[ "$output" = 'true' ]
|
|
33
17
|
}
|
|
34
18
|
|
|
35
|
-
@test '
|
|
19
|
+
@test 'year divisible by 100, not divisible by 400: common year' {
|
|
36
20
|
skip
|
|
37
|
-
run ./leap.sh
|
|
21
|
+
run ./leap.sh 2100
|
|
38
22
|
|
|
39
23
|
[ "$status" -eq 0 ]
|
|
40
|
-
[ "$output" =
|
|
24
|
+
[ "$output" = 'false' ]
|
|
41
25
|
}
|
|
42
26
|
|
|
43
|
-
@test '
|
|
27
|
+
@test 'year divisible by 400: leap year' {
|
|
44
28
|
skip
|
|
45
29
|
run ./leap.sh 2000
|
|
46
30
|
|
|
47
31
|
[ "$status" -eq 0 ]
|
|
48
|
-
[ "$output" =
|
|
32
|
+
[ "$output" = 'true' ]
|
|
49
33
|
}
|
|
50
34
|
|
|
51
35
|
@test 'No input should return an error' {
|
|
@@ -53,15 +37,15 @@
|
|
|
53
37
|
run ./leap.sh
|
|
54
38
|
|
|
55
39
|
[ "$status" -eq 1 ]
|
|
56
|
-
[ "$output" =
|
|
40
|
+
[ "$output" = 'Usage: leap.sh <year>' ]
|
|
57
41
|
}
|
|
58
42
|
|
|
59
|
-
@test 'Too
|
|
43
|
+
@test 'Too many arguments should return an error' {
|
|
60
44
|
skip
|
|
61
45
|
run ./leap.sh 2016 4562 4566
|
|
62
46
|
|
|
63
47
|
[ "$status" -eq 1 ]
|
|
64
|
-
[ "$output" =
|
|
48
|
+
[ "$output" = 'Usage: leap.sh <year>' ]
|
|
65
49
|
}
|
|
66
50
|
|
|
67
51
|
@test 'Float number input should return an error' {
|
|
@@ -69,13 +53,13 @@
|
|
|
69
53
|
run ./leap.sh 2016.54
|
|
70
54
|
|
|
71
55
|
[ "$status" -eq 1 ]
|
|
72
|
-
[ "$output" =
|
|
56
|
+
[ "$output" = 'Usage: leap.sh <year>' ]
|
|
73
57
|
}
|
|
74
58
|
|
|
75
59
|
@test 'Alpha input should return an error' {
|
|
76
60
|
skip
|
|
77
|
-
run ./leap.sh abcd
|
|
61
|
+
run ./leap.sh 'abcd'
|
|
78
62
|
|
|
79
63
|
[ "$status" -eq 1 ]
|
|
80
|
-
[ "$output" =
|
|
64
|
+
[ "$output" = 'Usage: leap.sh <year>' ]
|
|
81
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ceylon.test { ... }
|
|
2
2
|
|
|
3
|
-
// Tests adapted from problem-specifications version 1.0
|
|
3
|
+
// Tests adapted from problem-specifications version 1.1.0
|
|
4
4
|
{[String, {String*}, {String*}]*} cases => {
|
|
5
5
|
// no matches
|
|
6
6
|
["diaper", {"hello", "world", "zombies", "pants"}, {}],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ceylon.test { ... }
|
|
2
2
|
|
|
3
|
-
// Tests adapted from problem-specifications version 1.0
|
|
3
|
+
// Tests adapted from problem-specifications version 1.1.0
|
|
4
|
+
// The Ceylon track keeps the Error cases from 1.0.1 (removed in 1.1.0)
|
|
4
5
|
{[String, String|Null]*} cases => {
|
|
5
6
|
// empty strand
|
|
6
7
|
["", ""],
|