trackler 2.2.1.137 → 2.2.1.138
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/diffie-hellman/canonical-data.json +72 -0
- data/problem-specifications/exercises/yacht/description.md +2 -2
- data/tracks/csharp/exercises/sgf-parsing/Example.cs +1 -1
- data/tracks/csharp/exercises/sgf-parsing/SgfParsingTest.cs +1 -1
- data/tracks/csharp/exercises/sublist/SublistTest.cs +37 -78
- data/tracks/csharp/generators/Exercises/Sublist.cs +32 -0
- data/tracks/elisp/exercises/bob/README.md +2 -0
- data/tracks/elisp/exercises/bob/bob-test.el +60 -15
- data/tracks/elisp/exercises/bob/example.el +15 -5
- data/tracks/elisp/exercises/hamming/hamming-test.el +1 -1
- data/tracks/fsharp/build.ps1 +3 -3
- data/tracks/fsharp/build.sh +3 -3
- data/tracks/fsharp/exercises/bracket-push/BracketPushTest.fs +5 -1
- data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifierTest.fs +5 -1
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGardenTest.fs +1 -1
- data/tracks/fsharp/exercises/pov/PovTest.fs +6 -1
- data/tracks/fsharp/exercises/react/Example.fs +2 -2
- data/tracks/fsharp/exercises/react/React.fsproj +1 -0
- data/tracks/fsharp/exercises/react/ReactTest.fs +55 -33
- data/tracks/fsharp/exercises/series/Example.fs +2 -12
- data/tracks/fsharp/exercises/series/SeriesTest.fs +33 -56
- data/tracks/fsharp/generators/Generators.fs +81 -46
- data/tracks/idris/exercises/rna-transcription/src/{example.idr → Example.idr} +0 -0
- data/tracks/java/config.json +14 -0
- data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +10 -10
- data/tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java +39 -39
- data/tracks/java/exercises/grep/.meta/hints.md +58 -0
- data/tracks/java/exercises/grep/.meta/src/reference/java/GrepTool.java +65 -0
- data/tracks/java/exercises/grep/.meta/version +1 -0
- data/tracks/java/exercises/grep/README.md +145 -0
- data/tracks/java/exercises/grep/build.gradle +18 -0
- data/tracks/java/exercises/grep/src/main/java/.keep +0 -0
- data/tracks/java/exercises/grep/src/test/java/GrepToolTest.java +395 -0
- data/tracks/java/exercises/largest-series-product/src/test/java/LargestSeriesProductCalculatorTest.java +36 -36
- data/tracks/java/exercises/minesweeper/src/test/java/MinesweeperBoardTest.java +36 -36
- data/tracks/java/exercises/phone-number/src/test/java/PhoneNumberTest.java +14 -14
- data/tracks/java/exercises/poker/src/test/java/PokerTest.java +40 -40
- data/tracks/java/exercises/pythagorean-triplet/src/test/java/PythagoreanTripletTest.java +10 -10
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/ocaml/exercises/anagram/example.ml +1 -1
- data/tracks/ocaml/exercises/change/example.ml +1 -1
- data/tracks/ocaml/exercises/custom-set/example.ml +4 -3
- data/tracks/ocaml/exercises/custom-set/test.ml +0 -1
- data/tracks/ocaml/exercises/dominoes/test.ml +1 -1
- data/tracks/ocaml/exercises/etl/example.ml +1 -1
- data/tracks/ocaml/exercises/grade-school/example.ml +1 -1
- data/tracks/ocaml/exercises/palindrome-products/example.ml +2 -2
- data/tracks/ocaml/exercises/prime-factors/example.ml +1 -1
- data/tracks/ocaml/exercises/robot-name/test.ml +1 -1
- data/tracks/ocaml/exercises/triangle/example.ml +1 -1
- data/tracks/ocaml/make-exercise.sh +1 -0
- data/tracks/ocaml/tools/test-generator/src/controller.ml +1 -1
- data/tracks/perl5/exercises/raindrops/.meta/solutions/Raindrops.pm +13 -12
- data/tracks/perl5/exercises/raindrops/raindrops.t +166 -111
- data/tracks/perl6/docs/INSTALLATION.md +1 -3
- data/tracks/perl6/exercises/raindrops/.meta/exercise-data.yaml +5 -5
- data/tracks/perl6/exercises/raindrops/.meta/solutions/Raindrops.pm6 +2 -2
- data/tracks/perl6/exercises/raindrops/Raindrops.pm6 +2 -2
- data/tracks/perl6/exercises/raindrops/raindrops.t +3 -3
- data/tracks/python/exercises/food-chain/example.py +11 -2
- data/tracks/python/exercises/food-chain/food_chain_test.py +48 -45
- data/tracks/python/exercises/pov/pov_test.py +12 -1
- data/tracks/python/exercises/series/README.md +6 -6
- data/tracks/python/exercises/series/example.py +2 -3
- data/tracks/python/exercises/series/series_test.py +27 -28
- data/tracks/python/exercises/sgf-parsing/example.py +1 -1
- data/tracks/python/exercises/sgf-parsing/sgf_parsing_test.py +1 -1
- data/tracks/python/exercises/yacht/README.md +2 -2
- data/tracks/ruby/Gemfile +0 -1
- data/tracks/ruby/README.md +23 -0
- data/tracks/ruby/bin/generate +1 -0
- data/tracks/ruby/exercises/complex-numbers/complex_numbers_test.rb +1 -1
- data/tracks/ruby/lib/generator.rb +1 -2
- data/tracks/ruby/lib/generator/command_line.rb +3 -0
- data/tracks/ruby/lib/generator/command_line/generator_optparser.rb +1 -0
- data/tracks/ruby/lib/generator/exercise.rb +2 -0
- data/tracks/ruby/lib/generator/exercise_case.rb +3 -0
- data/tracks/ruby/lib/generator/files.rb +1 -0
- data/tracks/ruby/lib/generator/files/metadata_files.rb +2 -0
- data/tracks/ruby/lib/generator/files/track_files.rb +1 -0
- data/tracks/ruby/lib/generator/implementation.rb +1 -0
- data/tracks/ruby/lib/generator/repository.rb +3 -0
- data/tracks/ruby/lib/generator/template_values.rb +1 -0
- data/tracks/ruby/test/generator/case_values_test.rb +2 -0
- data/tracks/ruby/test/generator/command_line_test.rb +1 -0
- data/tracks/ruby/test/generator/files/metadata_files_test.rb +2 -0
- data/tracks/ruby/test/generator/files/track_files_test.rb +1 -0
- data/tracks/ruby/test/generator/implementation_test.rb +1 -0
- data/tracks/ruby/test/tasks/exercise_test.rb +1 -0
- data/tracks/ruby/test/tasks/exercise_test_tasks_test.rb +2 -0
- data/tracks/ruby/test/test_helper.rb +1 -3
- data/tracks/rust/config.json +12 -0
- data/tracks/rust/exercises/atbash-cipher/src/lib.rs +9 -0
- data/tracks/rust/exercises/hamming/src/lib.rs +6 -0
- data/tracks/rust/exercises/isogram/src/lib.rs +3 -0
- data/tracks/rust/exercises/luhn/src/lib.rs +4 -0
- data/tracks/rust/exercises/palindrome-products/.meta/test-in-release-mode +1 -0
- data/tracks/rust/exercises/palindrome-products/Cargo.toml +6 -0
- data/tracks/rust/exercises/palindrome-products/README.md +72 -0
- data/tracks/rust/exercises/palindrome-products/example.rs +25 -0
- data/tracks/rust/exercises/palindrome-products/src/lib.rs +22 -0
- data/tracks/rust/exercises/palindrome-products/tests/palindrome-products.rs +57 -0
- data/tracks/rust/exercises/pangram/src/lib.rs +4 -0
- data/tracks/rust/exercises/run-length-encoding/src/lib.rs +7 -0
- data/tracks/rust/exercises/say/src/lib.rs +3 -4
- data/tracks/rust/exercises/scrabble-score/src/lib.rs +4 -0
- data/tracks/rust/exercises/word-count/src/lib.rs +6 -0
- data/tracks/scheme/exercises/hello-world/example.scm +1 -4
- data/tracks/scheme/exercises/hello-world/hello-world-test.scm +1 -5
- data/tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm +2 -2
- data/tracks/typescript/config.json +30 -0
- data/tracks/typescript/exercises/queen-attack/README.md +59 -0
- data/tracks/typescript/exercises/queen-attack/package.json +36 -0
- data/tracks/typescript/exercises/queen-attack/queen-attack.example.ts +56 -0
- data/tracks/typescript/exercises/queen-attack/queen-attack.test.ts +71 -0
- data/tracks/typescript/exercises/queen-attack/queen-attack.ts +0 -0
- data/tracks/typescript/exercises/queen-attack/tsconfig.json +22 -0
- data/tracks/typescript/exercises/queen-attack/tslint.json +127 -0
- data/tracks/typescript/exercises/queen-attack/yarn.lock +2624 -0
- data/tracks/typescript/exercises/spiral-matrix/README.md +56 -0
- data/tracks/typescript/exercises/spiral-matrix/package.json +36 -0
- data/tracks/typescript/exercises/spiral-matrix/spiral-matrix.example.ts +33 -0
- data/tracks/typescript/exercises/spiral-matrix/spiral-matrix.test.ts +49 -0
- data/tracks/typescript/exercises/spiral-matrix/spiral-matrix.ts +0 -0
- data/tracks/typescript/exercises/spiral-matrix/tsconfig.json +22 -0
- data/tracks/typescript/exercises/spiral-matrix/tslint.json +127 -0
- data/tracks/typescript/exercises/spiral-matrix/yarn.lock +2624 -0
- metadata +35 -3
@@ -15,8 +15,8 @@ public class PythagoreanTripletTest {
|
|
15
15
|
@Test
|
16
16
|
public void shouldCalculateSum() {
|
17
17
|
PythagoreanTriplet triplet = new PythagoreanTriplet(3, 4, 5);
|
18
|
-
|
19
|
-
|
18
|
+
int expected = 12;
|
19
|
+
int actual = triplet.calculateSum();
|
20
20
|
assertEquals(expected, actual);
|
21
21
|
}
|
22
22
|
|
@@ -24,8 +24,8 @@ public class PythagoreanTripletTest {
|
|
24
24
|
@Test
|
25
25
|
public void shouldCalculateProduct() {
|
26
26
|
PythagoreanTriplet triplet = new PythagoreanTriplet(3, 4, 5);
|
27
|
-
|
28
|
-
|
27
|
+
long expected = 60l;
|
28
|
+
long actual = triplet.calculateProduct();
|
29
29
|
assertEquals(expected, actual);
|
30
30
|
}
|
31
31
|
|
@@ -46,7 +46,7 @@ public class PythagoreanTripletTest {
|
|
46
46
|
@Ignore("Remove to run test")
|
47
47
|
@Test
|
48
48
|
public void shouldMakeTripletsUpToTen() {
|
49
|
-
|
49
|
+
List<Long> actual
|
50
50
|
= PythagoreanTriplet
|
51
51
|
.makeTripletsList()
|
52
52
|
.withFactorsLessThanOrEqualTo(10)
|
@@ -55,14 +55,14 @@ public class PythagoreanTripletTest {
|
|
55
55
|
.map(t -> t.calculateProduct())
|
56
56
|
.sorted()
|
57
57
|
.collect(Collectors.toList());
|
58
|
-
|
58
|
+
List<Long> expected = Arrays.asList(60l, 480l);
|
59
59
|
assertEquals(expected, actual);
|
60
60
|
}
|
61
61
|
|
62
62
|
@Ignore("Remove to run test")
|
63
63
|
@Test
|
64
64
|
public void shouldMakeTripletsElevenToTwenty() {
|
65
|
-
|
65
|
+
List<Long> actual
|
66
66
|
= PythagoreanTriplet
|
67
67
|
.makeTripletsList()
|
68
68
|
.withFactorsGreaterThanOrEqualTo(11)
|
@@ -72,14 +72,14 @@ public class PythagoreanTripletTest {
|
|
72
72
|
.map(t -> t.calculateProduct())
|
73
73
|
.sorted((p1, p2) -> Double.compare(p1, p2))
|
74
74
|
.collect(Collectors.toList());
|
75
|
-
|
75
|
+
List<Long> expected = Arrays.asList(3840l);
|
76
76
|
assertEquals(expected, actual);
|
77
77
|
}
|
78
78
|
|
79
79
|
@Ignore("Remove to run test")
|
80
80
|
@Test
|
81
81
|
public void shouldMakeTripletsAndFilterOnSum() {
|
82
|
-
|
82
|
+
List<Long> actual
|
83
83
|
= PythagoreanTriplet
|
84
84
|
.makeTripletsList()
|
85
85
|
.withFactorsLessThanOrEqualTo(100)
|
@@ -89,7 +89,7 @@ public class PythagoreanTripletTest {
|
|
89
89
|
.map(t -> t.calculateProduct())
|
90
90
|
.sorted((p1, p2) -> Double.compare(p1, p2))
|
91
91
|
.collect(Collectors.toList());
|
92
|
-
|
92
|
+
List<Long> expected = Arrays.asList(118080l, 168480l, 202500l);
|
93
93
|
assertEquals(expected, actual);
|
94
94
|
}
|
95
95
|
}
|
@@ -8,7 +8,7 @@ let find_smallest_coins_list_meeting_target (cache: int list option array) (coin
|
|
8
8
|
List.filter coins ~f:(fun x -> x <= target)
|
9
9
|
|> List.map ~f:find_coins_meeting_target_minus_coin
|
10
10
|
|> List.filter_map ~f:(Fn.id)
|
11
|
-
|> List.sort ~
|
11
|
+
|> List.sort ~compare:(fun xs ys -> Int.compare (List.length xs) (List.length ys))
|
12
12
|
|> List.hd
|
13
13
|
|
14
14
|
let make_change ~target ~coins = match target with
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module type ELEMENT = sig
|
2
2
|
type t
|
3
3
|
val compare : t -> t -> int
|
4
|
-
val equal : t -> t -> bool
|
5
4
|
end
|
6
5
|
|
7
6
|
module Make(El: ELEMENT) = struct
|
@@ -12,11 +11,13 @@ module Make(El: ELEMENT) = struct
|
|
12
11
|
|
13
12
|
type el = El.t
|
14
13
|
|
14
|
+
let el_equal a b = El.compare a b = 0
|
15
|
+
|
15
16
|
let is_empty = function
|
16
17
|
| [] -> true
|
17
18
|
| _ -> false
|
18
19
|
|
19
|
-
let is_member l n = List.filter (
|
20
|
+
let is_member l n = List.filter (el_equal n) l |> is_empty |> not
|
20
21
|
|
21
22
|
let rec is_subset x y = match (x, y) with
|
22
23
|
| ([], []) -> true
|
@@ -34,7 +35,7 @@ module Make(El: ELEMENT) = struct
|
|
34
35
|
| ([], []) -> true
|
35
36
|
| ([], _) -> false
|
36
37
|
| (_, []) -> false
|
37
|
-
| ((x::xs), (y::ys)) ->
|
38
|
+
| ((x::xs), (y::ys)) -> el_equal x y && equal xs ys
|
38
39
|
|
39
40
|
let of_list = List.sort_uniq El.compare
|
40
41
|
|
@@ -20,7 +20,7 @@ let tuple_compare (x0, y0) (x1, y1) =
|
|
20
20
|
|
21
21
|
let norm l =
|
22
22
|
let norm1 (x, y) = if x > y then (y, x) else (x, y) in
|
23
|
-
List.map ~f:norm1 l |> List.sort ~
|
23
|
+
List.map ~f:norm1 l |> List.sort ~compare:tuple_compare
|
24
24
|
|
25
25
|
let check_chain (input: dominoe list) (chained: dominoe list) =
|
26
26
|
assert_equal (norm input) (norm chained) ~printer:dominoes_printer ~msg:"chain doesn't use the same dominoes as the input";
|
@@ -4,4 +4,4 @@ let transform data =
|
|
4
4
|
let assign_value value character = ((Char.lowercase character), value) in
|
5
5
|
let assign (value, characters) = List.map ~f:(assign_value value) characters in
|
6
6
|
let compare (a, _) (b, _) = Char.compare a b in
|
7
|
-
List.sort ~
|
7
|
+
List.sort ~compare:compare (List.concat (List.map ~f:assign data))
|
@@ -9,4 +9,4 @@ let add s g school = Map.add_multi ~key:g ~data:s school
|
|
9
9
|
|
10
10
|
let grade g school = Map.find school g |> Option.value ~default:[]
|
11
11
|
|
12
|
-
let sorted school = Map.map ~f:(List.sort ~
|
12
|
+
let sorted school = Map.map ~f:(List.sort ~compare:String.compare) school
|
@@ -31,7 +31,7 @@ let smallest ~min ~max =
|
|
31
31
|
|> Sequence.filter ~f:(fun (n, _) -> is_palindrome n) in
|
32
32
|
products
|
33
33
|
|> Sequence.to_list
|
34
|
-
|> List.sort ~
|
34
|
+
|> List.sort ~compare:(fun (x,_) (y,_) -> Int.compare x y)
|
35
35
|
|> List.group ~break:(fun (x, _) (y, _) -> x <> y)
|
36
36
|
|> List.hd
|
37
37
|
|> Option.map ~f:to_palindrome_products
|
@@ -50,7 +50,7 @@ let largest ~min ~max =
|
|
50
50
|
|> Sequence.filter ~f:(fun (n, _) -> is_palindrome n) in
|
51
51
|
products
|
52
52
|
|> Sequence.to_list
|
53
|
-
|> List.sort ~
|
53
|
+
|> List.sort ~compare:(fun (x,_) (y,_) -> Int.compare y x)
|
54
54
|
|> List.group ~break:(fun (x, _) (y, _) -> x <> y)
|
55
55
|
|> List.hd
|
56
56
|
|> Option.map ~f:to_palindrome_products
|
@@ -55,7 +55,7 @@ let unique_name_tests = [
|
|
55
55
|
then (Set.add repeated n, seen)
|
56
56
|
else (repeated, Set.add seen n)
|
57
57
|
) in
|
58
|
-
let first_few_repeats = Array.
|
58
|
+
let first_few_repeats = Array.sub (Set.to_array repeated) 0 (min 20 (Set.length repeated)) in
|
59
59
|
let failure_message = "first few repeats: " ^ (String.concat_array first_few_repeats ~sep:",") in
|
60
60
|
assert_bool failure_message (Set.is_empty repeated)
|
61
61
|
);
|
@@ -0,0 +1 @@
|
|
1
|
+
make test-assignment ASSIGNMENT=$1
|
@@ -85,7 +85,7 @@ let run ~(language_config: language_config) ~(templates_folder: string) ~(canoni
|
|
85
85
|
let check_canonical_data canonical_data_folder =
|
86
86
|
let ok_count = ref 0 in
|
87
87
|
let canonical_data_files = find_canonical_data_files canonical_data_folder in
|
88
|
-
let canonical_data_files = List.sort canonical_data_files ~
|
88
|
+
let canonical_data_files = List.sort canonical_data_files ~compare:(fun (s1, _) (s2, _) -> String.compare s1 s2) in
|
89
89
|
let total_count = List.length canonical_data_files in
|
90
90
|
List.iter canonical_data_files ~f:(fun (slug, text) ->
|
91
91
|
match parse_json_text text "cases" with
|
@@ -1,18 +1,19 @@
|
|
1
|
-
package Raindrops;
|
1
|
+
package Raindrops 1;
|
2
2
|
use strict;
|
3
3
|
use warnings;
|
4
|
+
use Exporter 'import';
|
5
|
+
our @EXPORT_OK = qw(raindrop);
|
4
6
|
|
5
|
-
sub
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
sub raindrop {
|
8
|
+
my ($num) = @_;
|
9
|
+
my %sounds = (Pling => 3, Plang => 5, Plong => 7);
|
10
|
+
my $str = '';
|
11
|
+
foreach (qw(Pling Plang Plong)) {
|
12
|
+
if ($num % $sounds{$_} == 0) {
|
13
|
+
$str .= $_;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
return $str || $num;
|
15
17
|
}
|
16
18
|
|
17
19
|
1;
|
18
|
-
|
@@ -1,123 +1,178 @@
|
|
1
1
|
#!/usr/bin/env perl
|
2
2
|
use strict;
|
3
3
|
use warnings;
|
4
|
-
|
5
|
-
use Test::More;
|
6
|
-
use JSON::PP qw(decode_json);
|
4
|
+
use JSON::PP;
|
7
5
|
use FindBin;
|
8
|
-
|
9
|
-
|
10
|
-
use lib $dir;
|
6
|
+
use lib $FindBin::Bin;
|
7
|
+
use Raindrops qw(raindrop);
|
11
8
|
|
12
|
-
my $
|
9
|
+
my $exercise = 'Raindrops';
|
10
|
+
my $test_version = 1;
|
11
|
+
use Test::More tests => 19;
|
13
12
|
|
14
|
-
my $
|
15
|
-
{
|
16
|
-
|
17
|
-
$
|
13
|
+
my $exercise_version = $exercise->VERSION // 0;
|
14
|
+
if ($exercise_version != $test_version) {
|
15
|
+
warn "\nExercise version mismatch. Further tests may fail!"
|
16
|
+
. "\n$exercise is v$exercise_version. "
|
17
|
+
. "Test is v$test_version.\n";
|
18
|
+
BAIL_OUT if $ENV{EXERCISM};
|
18
19
|
}
|
19
20
|
|
20
|
-
|
21
|
-
#diag explain $cases;
|
22
|
-
|
23
|
-
ok -e "${dir}${module}.pm", "missing $module.pm"
|
24
|
-
or BAIL_OUT("You need to create a class called $module.pm with a constructor called convert.");
|
25
|
-
|
26
|
-
eval "use $module";
|
27
|
-
ok !$@, "Cannot load $module.pm"
|
28
|
-
or BAIL_OUT("Does $module.pm compile? Does it end with 1; ? ($@)");
|
29
|
-
|
30
|
-
can_ok($module, 'convert') or BAIL_OUT("Missing package $module; or missing sub convert()");
|
21
|
+
can_ok $exercise, 'import' or BAIL_OUT 'Cannot import subroutines from module';
|
31
22
|
|
32
|
-
my $
|
33
|
-
|
34
|
-
|
35
|
-
is $sub->($c->{input}), $c->{expected}, $c->{name}
|
23
|
+
my $C_DATA = do { local $/; decode_json(<DATA>); };
|
24
|
+
foreach (@{$C_DATA->{cases}}) {
|
25
|
+
is raindrop($_->{input}{number}), $_->{expected}, $_->{description};
|
36
26
|
}
|
37
27
|
|
38
|
-
done_testing();
|
39
|
-
|
40
28
|
__DATA__
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
29
|
+
{
|
30
|
+
"exercise": "raindrops",
|
31
|
+
"version": "1.1.0",
|
32
|
+
"cases": [
|
33
|
+
{
|
34
|
+
"description": "the sound for 1 is 1",
|
35
|
+
"property": "convert",
|
36
|
+
"input": {
|
37
|
+
"number": 1
|
38
|
+
},
|
39
|
+
"expected": "1"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"description": "the sound for 3 is Pling",
|
43
|
+
"property": "convert",
|
44
|
+
"input": {
|
45
|
+
"number": 3
|
46
|
+
},
|
47
|
+
"expected": "Pling"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"description": "the sound for 5 is Plang",
|
51
|
+
"property": "convert",
|
52
|
+
"input": {
|
53
|
+
"number": 5
|
54
|
+
},
|
55
|
+
"expected": "Plang"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"description": "the sound for 7 is Plong",
|
59
|
+
"property": "convert",
|
60
|
+
"input": {
|
61
|
+
"number": 7
|
62
|
+
},
|
63
|
+
"expected": "Plong"
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"description": "the sound for 6 is Pling as it has a factor 3",
|
67
|
+
"property": "convert",
|
68
|
+
"input": {
|
69
|
+
"number": 6
|
70
|
+
},
|
71
|
+
"expected": "Pling"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"description": "2 to the power 3 does not make a raindrop sound as 3 is the exponent not the base",
|
75
|
+
"property": "convert",
|
76
|
+
"input": {
|
77
|
+
"number": 8
|
78
|
+
},
|
79
|
+
"expected": "8"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"description": "the sound for 9 is Pling as it has a factor 3",
|
83
|
+
"property": "convert",
|
84
|
+
"input": {
|
85
|
+
"number": 9
|
86
|
+
},
|
87
|
+
"expected": "Pling"
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"description": "the sound for 10 is Plang as it has a factor 5",
|
91
|
+
"property": "convert",
|
92
|
+
"input": {
|
93
|
+
"number": 10
|
94
|
+
},
|
95
|
+
"expected": "Plang"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"description": "the sound for 14 is Plong as it has a factor of 7",
|
99
|
+
"property": "convert",
|
100
|
+
"input": {
|
101
|
+
"number": 14
|
102
|
+
},
|
103
|
+
"expected": "Plong"
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"description": "the sound for 15 is PlingPlang as it has factors 3 and 5",
|
107
|
+
"property": "convert",
|
108
|
+
"input": {
|
109
|
+
"number": 15
|
110
|
+
},
|
111
|
+
"expected": "PlingPlang"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"description": "the sound for 21 is PlingPlong as it has factors 3 and 7",
|
115
|
+
"property": "convert",
|
116
|
+
"input": {
|
117
|
+
"number": 21
|
118
|
+
},
|
119
|
+
"expected": "PlingPlong"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"description": "the sound for 25 is Plang as it has a factor 5",
|
123
|
+
"property": "convert",
|
124
|
+
"input": {
|
125
|
+
"number": 25
|
126
|
+
},
|
127
|
+
"expected": "Plang"
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"description": "the sound for 27 is Pling as it has a factor 3",
|
131
|
+
"property": "convert",
|
132
|
+
"input": {
|
133
|
+
"number": 27
|
134
|
+
},
|
135
|
+
"expected": "Pling"
|
136
|
+
},
|
137
|
+
{
|
138
|
+
"description": "the sound for 35 is PlangPlong as it has factors 5 and 7",
|
139
|
+
"property": "convert",
|
140
|
+
"input": {
|
141
|
+
"number": 35
|
142
|
+
},
|
143
|
+
"expected": "PlangPlong"
|
144
|
+
},
|
145
|
+
{
|
146
|
+
"description": "the sound for 49 is Plong as it has a factor 7",
|
147
|
+
"property": "convert",
|
148
|
+
"input": {
|
149
|
+
"number": 49
|
150
|
+
},
|
151
|
+
"expected": "Plong"
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"description": "the sound for 52 is 52",
|
155
|
+
"property": "convert",
|
156
|
+
"input": {
|
157
|
+
"number": 52
|
158
|
+
},
|
159
|
+
"expected": "52"
|
160
|
+
},
|
161
|
+
{
|
162
|
+
"description": "the sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7",
|
163
|
+
"property": "convert",
|
164
|
+
"input": {
|
165
|
+
"number": 105
|
166
|
+
},
|
167
|
+
"expected": "PlingPlangPlong"
|
168
|
+
},
|
169
|
+
{
|
170
|
+
"description": "the sound for 3125 is Plang as it has a factor 5",
|
171
|
+
"property": "convert",
|
172
|
+
"input": {
|
173
|
+
"number": 3125
|
174
|
+
},
|
175
|
+
"expected": "Plang"
|
176
|
+
}
|
177
|
+
]
|
178
|
+
}
|