trackler 2.2.1.61 → 2.2.1.62
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/exercises/forth/canonical-data.json +1 -7
- data/problem-specifications/exercises/meetup/description.md +16 -12
- data/problem-specifications/exercises/sum-of-multiples/description.md +3 -3
- data/tracks/c/config.json +14 -1
- data/tracks/c/exercises/anagram/src/anagram.h +19 -4
- data/tracks/c/exercises/anagram/src/example.c +27 -40
- data/tracks/c/exercises/anagram/test/test_anagram.c +100 -152
- data/tracks/c/exercises/sublist/README.md +53 -0
- data/tracks/c/exercises/sublist/makefile +15 -0
- data/tracks/c/exercises/sublist/src/example.c +63 -0
- data/tracks/c/exercises/sublist/src/sublist.h +17 -0
- data/tracks/c/exercises/sublist/test/test_sublist.c +243 -0
- data/tracks/c/exercises/sublist/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/sublist/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/sublist/test/vendor/unity_internals.h +701 -0
- data/tracks/ecmascript/config.json +56 -0
- data/tracks/ecmascript/exercises/rectangles/README.md +95 -0
- data/tracks/ecmascript/exercises/rectangles/example.js +38 -0
- data/tracks/ecmascript/exercises/rectangles/package.json +72 -0
- data/tracks/ecmascript/exercises/rectangles/rectangles.spec.js +147 -0
- data/tracks/ecmascript/exercises/rotational-cipher/README.md +66 -0
- data/tracks/ecmascript/exercises/rotational-cipher/example.js +16 -0
- data/tracks/ecmascript/exercises/rotational-cipher/package.json +72 -0
- data/tracks/ecmascript/exercises/rotational-cipher/rotational-cipher.spec.js +73 -0
- data/tracks/ecmascript/exercises/spiral-matrix/README.md +59 -0
- data/tracks/ecmascript/exercises/spiral-matrix/example.js +26 -0
- data/tracks/ecmascript/exercises/spiral-matrix/package.json +72 -0
- data/tracks/ecmascript/exercises/spiral-matrix/spiral-matrix.spec.js +55 -0
- data/tracks/ecmascript/exercises/transpose/README.md +94 -0
- data/tracks/ecmascript/exercises/transpose/example.js +12 -0
- data/tracks/ecmascript/exercises/transpose/package.json +71 -0
- data/tracks/ecmascript/exercises/transpose/transpose.spec.js +121 -0
- data/tracks/go/exercises/allergies/.meta/gen.go +88 -0
- data/tracks/go/exercises/allergies/allergies_test.go +19 -46
- data/tracks/go/exercises/allergies/cases_test.go +60 -0
- data/tracks/go/exercises/bob/bob.go +0 -2
- data/tracks/go/exercises/forth/cases_test.go +2 -7
- data/tracks/go/exercises/nucleotide-count/nucleotide_count.go +0 -2
- data/tracks/go/exercises/pangram/.meta/gen.go +54 -0
- data/tracks/go/exercises/pangram/cases_test.go +62 -0
- data/tracks/go/exercises/pangram/example.go +3 -5
- data/tracks/go/exercises/pangram/pangram_test.go +3 -24
- data/tracks/go/exercises/rna-transcription/rna_transcription.go +0 -2
- data/tracks/go/exercises/robot-name/bonus_example.go +0 -2
- data/tracks/java/exercises/acronym/.meta/src/reference/java/Acronym.java +3 -3
- data/tracks/lfe/config.json +4 -3
- data/tracks/perl6/docs/SNIPPET.txt +8 -3
- data/tracks/perl6/exercises/allergies/Allergies.pm6 +1 -1
- data/tracks/perl6/exercises/allergies/Example.pm6 +1 -1
- data/tracks/perl6/exercises/allergies/allergies.t +10 -2
- data/tracks/perl6/exercises/allergies/example.yaml +10 -2
- data/tracks/perl6/exercises/leap/Example.pm6 +1 -1
- data/tracks/perl6/exercises/leap/Leap.pm6 +1 -1
- data/tracks/perl6/exercises/leap/example.yaml +10 -2
- data/tracks/perl6/exercises/leap/leap.t +10 -2
- data/tracks/perl6/exercises/luhn/Example.pm6 +1 -1
- data/tracks/perl6/exercises/luhn/Luhn.pm6 +1 -1
- data/tracks/perl6/exercises/luhn/example.yaml +10 -2
- data/tracks/perl6/exercises/luhn/luhn.t +10 -2
- data/tracks/perl6/exercises/pangram/Example.pm6 +1 -1
- data/tracks/perl6/exercises/pangram/Pangram.pm6 +1 -1
- data/tracks/perl6/exercises/pangram/example.yaml +12 -6
- data/tracks/perl6/exercises/pangram/pangram.t +9 -3
- data/tracks/python/config.json +38 -0
- data/tracks/python/exercises/complex-numbers/complex_numbers_test.py +81 -66
- data/tracks/python/exercises/connect/README.md +44 -0
- data/tracks/python/exercises/connect/connect.py +7 -0
- data/tracks/python/exercises/connect/connect_test.py +118 -0
- data/tracks/python/exercises/connect/example.py +61 -0
- data/tracks/python/exercises/go-counting/README.md +44 -0
- data/tracks/python/exercises/go-counting/example.py +62 -0
- data/tracks/python/exercises/go-counting/go_counting.py +38 -0
- data/tracks/python/exercises/go-counting/go_counting_test.py +92 -0
- data/tracks/python/exercises/parallel-letter-frequency/README.md +24 -0
- data/tracks/python/exercises/parallel-letter-frequency/example.py +56 -0
- data/tracks/python/exercises/parallel-letter-frequency/parallel_letter_frequency.py +2 -0
- data/tracks/python/exercises/parallel-letter-frequency/parallel_letter_frequency_test.py +61 -0
- data/tracks/python/exercises/strain/README.md +3 -1
- data/tracks/python/exercises/strain/strain.py +2 -2
- data/tracks/rust/.travis.yml +1 -0
- data/tracks/rust/README.md +2 -0
- data/tracks/rust/_test/check-exercises.sh +41 -54
- data/tracks/rust/_test/ensure-readmes-are-updated.sh +40 -0
- data/tracks/rust/bin/test-exercise +84 -0
- data/tracks/rust/exercises/alphametics/.meta/test-in-release-mode +2 -0
- data/tracks/rust/exercises/alphametics/src/lib.rs +1 -1
- data/tracks/rust/exercises/dominoes/README.md +3 -3
- data/tracks/rust/exercises/isbn-verifier/README.md +3 -2
- data/tracks/rust/exercises/nucleotide-count/README.md +2 -2
- data/tracks/rust/exercises/perfect-numbers/src/lib.rs +10 -0
- data/tracks/rust/exercises/phone-number/README.md +1 -1
- data/tracks/rust/exercises/pythagorean-triplet/src/lib.rs +3 -0
- data/tracks/rust/exercises/rectangles/README.md +9 -9
- data/tracks/rust/exercises/two-bucket/README.md +7 -7
- data/tracks/typescript/config.json +16 -0
- data/tracks/typescript/exercises/diamond/README.md +84 -0
- data/tracks/typescript/exercises/diamond/diamond.example.ts +51 -0
- data/tracks/typescript/exercises/diamond/diamond.test.ts +35 -0
- data/tracks/typescript/exercises/diamond/diamond.ts +0 -0
- data/tracks/typescript/exercises/diamond/package.json +36 -0
- data/tracks/typescript/exercises/diamond/tsconfig.json +22 -0
- data/tracks/typescript/exercises/diamond/tslint.json +127 -0
- data/tracks/typescript/exercises/diamond/yarn.lock +2624 -0
- metadata +53 -2
@@ -1,8 +1,8 @@
|
|
1
1
|
package forth
|
2
2
|
|
3
3
|
// Source: exercism/problem-specifications
|
4
|
-
// Commit:
|
5
|
-
// Problem Specifications Version: 1.
|
4
|
+
// Commit: 3cb5e76 forth: Remove test for empty input (#976)
|
5
|
+
// Problem Specifications Version: 1.3.0
|
6
6
|
|
7
7
|
type testGroup struct {
|
8
8
|
group string
|
@@ -19,11 +19,6 @@ var testGroups = []testGroup{
|
|
19
19
|
{
|
20
20
|
group: "parsing and numbers",
|
21
21
|
tests: []testCase{
|
22
|
-
{
|
23
|
-
"empty input results in empty stack",
|
24
|
-
[]string{},
|
25
|
-
[]int{},
|
26
|
-
},
|
27
22
|
{
|
28
23
|
"numbers just get pushed onto the stack",
|
29
24
|
[]string{"1 2 3 4 5"},
|
@@ -0,0 +1,54 @@
|
|
1
|
+
package main
|
2
|
+
|
3
|
+
import (
|
4
|
+
"log"
|
5
|
+
"text/template"
|
6
|
+
|
7
|
+
"../../../gen"
|
8
|
+
)
|
9
|
+
|
10
|
+
func main() {
|
11
|
+
t, err := template.New("").Parse(tmpl)
|
12
|
+
if err != nil {
|
13
|
+
log.Fatal(err)
|
14
|
+
}
|
15
|
+
var j js
|
16
|
+
if err := gen.Gen("pangram", &j, t); err != nil {
|
17
|
+
log.Fatal(err)
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
// The JSON structure we expect to be able to unmarshal into
|
22
|
+
type js struct {
|
23
|
+
Exercise string
|
24
|
+
Version string
|
25
|
+
Cases []struct {
|
26
|
+
Cases []oneCase
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
// Test cases
|
31
|
+
type oneCase struct {
|
32
|
+
Description string
|
33
|
+
Property string
|
34
|
+
Input string
|
35
|
+
Expected bool
|
36
|
+
}
|
37
|
+
|
38
|
+
// Template to generate test cases.
|
39
|
+
var tmpl = `package pangram
|
40
|
+
|
41
|
+
{{.Header}}
|
42
|
+
|
43
|
+
var testCases = []struct {
|
44
|
+
description string
|
45
|
+
input string
|
46
|
+
expected bool
|
47
|
+
}{ {{range .J.Cases}}{{range .Cases}}
|
48
|
+
{
|
49
|
+
description: {{printf "%q" .Description}},
|
50
|
+
input: {{printf "%q" .Input}},
|
51
|
+
expected: {{printf "%t" .Expected}},
|
52
|
+
},{{end}}{{end}}
|
53
|
+
}
|
54
|
+
`
|
@@ -0,0 +1,62 @@
|
|
1
|
+
package pangram
|
2
|
+
|
3
|
+
// Source: exercism/problem-specifications
|
4
|
+
// Commit: d79e13e pangram: fix duplicative case for a missing 'x' (#958)
|
5
|
+
// Problem Specifications Version: 1.3.0
|
6
|
+
|
7
|
+
var testCases = []struct {
|
8
|
+
description string
|
9
|
+
input string
|
10
|
+
expected bool
|
11
|
+
}{
|
12
|
+
{
|
13
|
+
description: "sentence empty",
|
14
|
+
input: "",
|
15
|
+
expected: false,
|
16
|
+
},
|
17
|
+
{
|
18
|
+
description: "recognizes a perfect lower case pangram",
|
19
|
+
input: "abcdefghijklmnopqrstuvwxyz",
|
20
|
+
expected: true,
|
21
|
+
},
|
22
|
+
{
|
23
|
+
description: "pangram with only lower case",
|
24
|
+
input: "the quick brown fox jumps over the lazy dog",
|
25
|
+
expected: true,
|
26
|
+
},
|
27
|
+
{
|
28
|
+
description: "missing character 'x'",
|
29
|
+
input: "a quick movement of the enemy will jeopardize five gunboats",
|
30
|
+
expected: false,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
description: "another missing character, e.g. 'h'",
|
34
|
+
input: "five boxing wizards jump quickly at it",
|
35
|
+
expected: false,
|
36
|
+
},
|
37
|
+
{
|
38
|
+
description: "pangram with underscores",
|
39
|
+
input: "the_quick_brown_fox_jumps_over_the_lazy_dog",
|
40
|
+
expected: true,
|
41
|
+
},
|
42
|
+
{
|
43
|
+
description: "pangram with numbers",
|
44
|
+
input: "the 1 quick brown fox jumps over the 2 lazy dogs",
|
45
|
+
expected: true,
|
46
|
+
},
|
47
|
+
{
|
48
|
+
description: "missing letters replaced by numbers",
|
49
|
+
input: "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog",
|
50
|
+
expected: false,
|
51
|
+
},
|
52
|
+
{
|
53
|
+
description: "pangram with mixed case and punctuation",
|
54
|
+
input: "\"Five quacking Zephyrs jolt my wax bed.\"",
|
55
|
+
expected: true,
|
56
|
+
},
|
57
|
+
{
|
58
|
+
description: "upper and lower case versions of the same character should not be counted separately",
|
59
|
+
input: "the quick brown fox jumps over with lazy FX",
|
60
|
+
expected: false,
|
61
|
+
},
|
62
|
+
}
|
@@ -1,14 +1,12 @@
|
|
1
1
|
package pangram
|
2
2
|
|
3
|
-
import
|
4
|
-
"strings"
|
5
|
-
)
|
3
|
+
import "strings"
|
6
4
|
|
5
|
+
// IsPangram checks if given string is a pangram
|
7
6
|
func IsPangram(s string) bool {
|
8
|
-
lowerString := strings.ToLower(s)
|
9
7
|
var check [26]bool
|
10
8
|
var count int
|
11
|
-
for _, c := range
|
9
|
+
for _, c := range strings.ToLower(s) {
|
12
10
|
if c >= 'a' {
|
13
11
|
if c > 'z' {
|
14
12
|
continue
|
@@ -4,33 +4,12 @@ import (
|
|
4
4
|
"testing"
|
5
5
|
)
|
6
6
|
|
7
|
-
type testCase struct {
|
8
|
-
input string
|
9
|
-
expected bool
|
10
|
-
failureReason string
|
11
|
-
}
|
12
|
-
|
13
|
-
var testCases = []testCase{
|
14
|
-
{"", false, "sentence empty"},
|
15
|
-
{"The quick brown fox jumps over the lazy dog", true, ""},
|
16
|
-
{"a quick movement of the enemy will jeopardize five gunboats", false, "missing character 'x'"},
|
17
|
-
{"the quick brown fish jumps over the lazy dog", false, "another missing character 'x'"},
|
18
|
-
{"the 1 quick brown fox jumps over the 2 lazy dogs", true, ""},
|
19
|
-
{"7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog", false, "missing letters replaced by numbers"},
|
20
|
-
{"\"Five quacking Zephyrs jolt my wax bed.\"", true, ""},
|
21
|
-
{"abcdefghijklmnopqrstuvwxy", false, "missing character 'z'"},
|
22
|
-
{"bcdefghijklmnopqrstuvwxyz", false, "missing character 'a'"},
|
23
|
-
}
|
24
|
-
|
25
7
|
func TestPangram(t *testing.T) {
|
26
8
|
for _, test := range testCases {
|
27
|
-
actual := IsPangram(test.input)
|
28
|
-
|
29
|
-
t.Errorf("Pangram test [%s], expected [%t], actual [%t]", test.input, test.expected, actual)
|
30
|
-
if !test.expected {
|
31
|
-
t.Logf("[%s] should not be a pangram because : %s\n", test.input, test.failureReason)
|
32
|
-
}
|
9
|
+
if actual := IsPangram(test.input); actual != test.expected {
|
10
|
+
t.Fatalf("FAIL: %s\nInput %q expected [%t], actual [%t]", test.description, test.input, test.expected, actual)
|
33
11
|
}
|
12
|
+
t.Logf("PASS: %s", test.description)
|
34
13
|
}
|
35
14
|
}
|
36
15
|
|
@@ -16,11 +16,11 @@ final class Acronym {
|
|
16
16
|
private String generateAcronym(String phrase){
|
17
17
|
final Pattern BREAK_WORDS = Pattern.compile("[A-Z]+[a-z]*|[a-z]+");
|
18
18
|
final Matcher matcher = BREAK_WORDS.matcher(phrase);
|
19
|
-
final StringBuilder
|
19
|
+
final StringBuilder stringBuilder = new StringBuilder();
|
20
20
|
while (matcher.find()){
|
21
|
-
|
21
|
+
stringBuilder.append(matcher.group().charAt(0));
|
22
22
|
}
|
23
|
-
return
|
23
|
+
return stringBuilder.toString().toUpperCase();
|
24
24
|
}
|
25
25
|
|
26
26
|
}
|
data/tracks/lfe/config.json
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
{
|
2
|
+
"language": "LFE",
|
3
|
+
"blurb": "Lisp Flavoured Erlang is one of those eat your cake and have it too programming languages. As they say: It's the best of Erlang and of Lisp; at the same time!",
|
2
4
|
"active": true,
|
3
5
|
"exercises": [
|
4
6
|
{
|
@@ -247,6 +249,5 @@
|
|
247
249
|
"uuid": "d706e999-482a-42de-8492-0a65e6258c19"
|
248
250
|
}
|
249
251
|
],
|
250
|
-
"foregone": []
|
251
|
-
|
252
|
-
}
|
252
|
+
"foregone": []
|
253
|
+
}
|
@@ -1,5 +1,10 @@
|
|
1
|
-
|
1
|
+
say my $candidates = all
|
2
|
+
(‘Alphabet’, ‘subdermatoglyphic’,
|
3
|
+
‘Emily Jung Schwartzkopf’).pick: 2;
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
+
say “All isograms? {$_ ?? ‘✔’ !! ‘❌’}”
|
6
|
+
given is-isogram($candidates).so;
|
7
|
+
|
8
|
+
sub is-isogram (Str $_ --> Bool) {
|
9
|
+
.uc.comb(/<:L>/).Bag ⊆ 'A'..'Z';
|
5
10
|
}
|
@@ -1 +1 @@
|
|
1
|
-
unit module Allergies:ver<
|
1
|
+
unit module Allergies:ver<3>;
|
@@ -5,7 +5,7 @@ use lib my $dir = $?FILE.IO.dirname;
|
|
5
5
|
use JSON::Fast;
|
6
6
|
|
7
7
|
my Str:D $exercise := 'Allergies';
|
8
|
-
my Version:D $version =
|
8
|
+
my Version:D $version = v3;
|
9
9
|
my Str $module //= $exercise;
|
10
10
|
plan 4;
|
11
11
|
|
@@ -27,7 +27,15 @@ for $c-data<cases>.values -> %case-set {
|
|
27
27
|
subtest 'allergic-to' => {
|
28
28
|
plan 7;
|
29
29
|
for %case-set<cases>.values -> %case {
|
30
|
-
|
30
|
+
for %case<expected>.values {
|
31
|
+
given allergic-to %case<score>, .<substance> -> $result {
|
32
|
+
subtest %case<description> ~ ': ' ~ .<substance> => {
|
33
|
+
plan 2;
|
34
|
+
isa-ok $result, Bool;
|
35
|
+
is-deeply $result, .<result>, 'Result matches expected';
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
31
39
|
}
|
32
40
|
} when %case-set<description> ~~ 'allergicTo';
|
33
41
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
exercise: Allergies
|
2
|
-
version:
|
2
|
+
version: 3
|
3
3
|
plan: 4
|
4
4
|
imports: '&allergic-to &list-allergies'
|
5
5
|
tests: |-
|
@@ -8,7 +8,15 @@ tests: |-
|
|
8
8
|
subtest 'allergic-to' => {
|
9
9
|
plan 7;
|
10
10
|
for %case-set<cases>.values -> %case {
|
11
|
-
|
11
|
+
for %case<expected>.values {
|
12
|
+
given allergic-to %case<score>, .<substance> -> $result {
|
13
|
+
subtest %case<description> ~ ': ' ~ .<substance> => {
|
14
|
+
plan 2;
|
15
|
+
isa-ok $result, Bool;
|
16
|
+
is-deeply $result, .<result>, 'Result matches expected';
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
12
20
|
}
|
13
21
|
} when %case-set<description> ~~ 'allergicTo';
|
14
22
|
|
@@ -1,9 +1,17 @@
|
|
1
1
|
exercise: Leap
|
2
|
-
version:
|
2
|
+
version: 3
|
3
3
|
plan: 6
|
4
4
|
imports: '&is-leap-year'
|
5
5
|
tests: |-
|
6
|
-
|
6
|
+
for $c-data<cases>.values {
|
7
|
+
given is-leap-year .<input> -> $result {
|
8
|
+
subtest .<description>, {
|
9
|
+
plan 2;
|
10
|
+
isa-ok $result, Bool;
|
11
|
+
is-deeply $result, .<expected>, 'Result matches expected';
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
7
15
|
|
8
16
|
unit: module
|
9
17
|
example: |-
|
@@ -5,7 +5,7 @@ use lib my $dir = $?FILE.IO.dirname;
|
|
5
5
|
use JSON::Fast;
|
6
6
|
|
7
7
|
my Str:D $exercise := 'Leap';
|
8
|
-
my Version:D $version =
|
8
|
+
my Version:D $version = v3;
|
9
9
|
my Str $module //= $exercise;
|
10
10
|
plan 6;
|
11
11
|
|
@@ -22,7 +22,15 @@ if ::($exercise).^ver !~~ $version {
|
|
22
22
|
require ::($module) <&is-leap-year>;
|
23
23
|
|
24
24
|
my $c-data = from-json $=pod.pop.contents;
|
25
|
-
|
25
|
+
for $c-data<cases>.values {
|
26
|
+
given is-leap-year .<input> -> $result {
|
27
|
+
subtest .<description>, {
|
28
|
+
plan 2;
|
29
|
+
isa-ok $result, Bool;
|
30
|
+
is-deeply $result, .<expected>, 'Result matches expected';
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
26
34
|
|
27
35
|
=head2 Canonical Data
|
28
36
|
=begin code
|
@@ -1,9 +1,17 @@
|
|
1
1
|
exercise: Luhn
|
2
|
-
version:
|
2
|
+
version: 2
|
3
3
|
plan: 15
|
4
4
|
imports: '&is-luhn-valid'
|
5
5
|
tests: |-
|
6
|
-
|
6
|
+
for $c-data<cases>.values {
|
7
|
+
given is-luhn-valid .<input> -> $result {
|
8
|
+
subtest .<description>, {
|
9
|
+
plan 2;
|
10
|
+
isa-ok $result, Bool;
|
11
|
+
is-deeply $result, .<expected>, 'Result matches expected';
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
7
15
|
|
8
16
|
unit: module
|
9
17
|
example: |-
|
@@ -5,7 +5,7 @@ use lib my $dir = $?FILE.IO.dirname;
|
|
5
5
|
use JSON::Fast;
|
6
6
|
|
7
7
|
my Str:D $exercise := 'Luhn';
|
8
|
-
my Version:D $version =
|
8
|
+
my Version:D $version = v2;
|
9
9
|
my Str $module //= $exercise;
|
10
10
|
plan 15;
|
11
11
|
|
@@ -22,7 +22,15 @@ if ::($exercise).^ver !~~ $version {
|
|
22
22
|
require ::($module) <&is-luhn-valid>;
|
23
23
|
|
24
24
|
my $c-data = from-json $=pod.pop.contents;
|
25
|
-
|
25
|
+
for $c-data<cases>.values {
|
26
|
+
given is-luhn-valid .<input> -> $result {
|
27
|
+
subtest .<description>, {
|
28
|
+
plan 2;
|
29
|
+
isa-ok $result, Bool;
|
30
|
+
is-deeply $result, .<expected>, 'Result matches expected';
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
26
34
|
|
27
35
|
=head2 Canonical Data
|
28
36
|
=begin code
|