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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/bowling/canonical-data.json +95 -39
  4. data/problem-specifications/exercises/gigasecond/canonical-data.json +17 -7
  5. data/problem-specifications/exercises/pangram/canonical-data.json +32 -12
  6. data/problem-specifications/exercises/say/canonical-data.json +47 -17
  7. data/problem-specifications/exercises/sum-of-multiples/canonical-data.json +54 -28
  8. data/problem-specifications/exercises/triangle/canonical-data.json +52 -18
  9. data/problem-specifications/exercises/two-bucket/canonical-data.json +38 -26
  10. data/problem-specifications/exercises/two-fer/canonical-data.json +14 -8
  11. data/problem-specifications/exercises/word-count/canonical-data.json +35 -13
  12. data/problem-specifications/exercises/wordy/canonical-data.json +50 -18
  13. data/tracks/bash/exercises/leap/.meta/version +1 -0
  14. data/tracks/bash/exercises/leap/example.sh +9 -9
  15. data/tracks/bash/exercises/leap/leap_test.sh +17 -33
  16. data/tracks/ceylon/exercises/anagram/source/anagram/AnagramTest.ceylon +1 -1
  17. data/tracks/ceylon/exercises/bracket-push/source/bracketpush/BracketsTest.ceylon +1 -1
  18. data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/RNATest.ceylon +2 -1
  19. data/tracks/fsharp/build.cake +2 -7
  20. data/tracks/fsharp/exercises/acronym/AcronymTest.fs +1 -1
  21. data/tracks/fsharp/exercises/all-your-base/AllYourBase.fs +1 -1
  22. data/tracks/fsharp/exercises/all-your-base/AllYourBaseTest.fs +43 -43
  23. data/tracks/fsharp/exercises/all-your-base/Example.fs +5 -5
  24. data/tracks/fsharp/exercises/allergies/AllergiesTest.fs +1 -1
  25. data/tracks/fsharp/exercises/alphametics/AlphameticsTest.fs +19 -1
  26. data/tracks/fsharp/exercises/alphametics/Example.fs +53 -34
  27. data/tracks/fsharp/exercises/anagram/AnagramTest.fs +1 -1
  28. data/tracks/fsharp/exercises/atbash-cipher/AtbashCipherTest.fs +1 -1
  29. data/tracks/fsharp/exercises/beer-song/BeerSongTest.fs +1 -1
  30. data/tracks/fsharp/exercises/binary-search/BinarySearchTest.fs +1 -1
  31. data/tracks/fsharp/exercises/bob/BobTest.fs +1 -1
  32. data/tracks/fsharp/exercises/book-store/BookStoreTest.fs +1 -1
  33. data/tracks/fsharp/exercises/bracket-push/BracketPushTest.fs +1 -1
  34. data/tracks/fsharp/exercises/change/ChangeTest.fs +1 -1
  35. data/tracks/fsharp/exercises/collatz-conjecture/CollatzConjectureTest.fs +1 -1
  36. data/tracks/fsharp/exercises/connect/ConnectTest.fs +1 -1
  37. data/tracks/fsharp/exercises/crypto-square/CryptoSquareTest.fs +1 -1
  38. data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquaresTest.fs +1 -1
  39. data/tracks/fsharp/exercises/dominoes/DominoesTest.fs +25 -25
  40. data/tracks/fsharp/exercises/etl/EtlTest.fs +8 -8
  41. data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifierTest.fs +5 -1
  42. data/tracks/fsharp/exercises/luhn/LuhnTest.fs +1 -1
  43. data/tracks/fsharp/exercises/meetup/Example.fs +11 -11
  44. data/tracks/fsharp/exercises/meetup/Meetup.fs +2 -2
  45. data/tracks/fsharp/exercises/meetup/MeetupTest.fs +96 -96
  46. data/tracks/fsharp/exercises/robot-simulator/Example.fs +21 -21
  47. data/tracks/fsharp/exercises/robot-simulator/RobotSimulator.fs +5 -5
  48. data/tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs +78 -96
  49. data/tracks/fsharp/generators/CanonicalData.fs +50 -4
  50. data/tracks/fsharp/generators/Common.fs +4 -13
  51. data/tracks/fsharp/generators/Exercise.fs +31 -15
  52. data/tracks/fsharp/generators/Generators.fs +76 -111
  53. data/tracks/haskell/exercises/alphametics/package.yaml +1 -1
  54. data/tracks/haskell/exercises/alphametics/test/Tests.hs +5 -0
  55. data/tracks/haskell/exercises/bowling/package.yaml +1 -1
  56. data/tracks/haskell/exercises/pangram/package.yaml +1 -1
  57. data/tracks/haskell/exercises/say/package.yaml +1 -1
  58. data/tracks/haskell/exercises/sum-of-multiples/package.yaml +1 -1
  59. data/tracks/haskell/exercises/word-count/package.yaml +1 -1
  60. data/tracks/haskell/exercises/wordy/package.yaml +1 -1
  61. data/tracks/java/exercises/nucleotide-count/.meta/hints.md +58 -0
  62. data/tracks/java/exercises/nucleotide-count/README.md +62 -0
  63. metadata +4 -2
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "word-count",
3
- "version": "1.0.0",
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": "word",
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": "one of each",
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": "one fish two fish red fish blue fish",
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": "one,two,three",
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": "one,\ntwo,\nthree",
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": "car: carpet as java: javascript!!&@$%^&",
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": "testing, 1, 2 testing",
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": "go Go GO Stop stop",
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": "First: don't laugh. Then: don't cry.",
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": "Joe can't tell between 'large' and large.",
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": " multiple whitespaces",
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.0.0",
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": "What is 1 plus 1?",
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": "What is 53 plus 2?",
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": "What is -1 plus -10?",
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": "What is 123 plus 45678?",
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": "What is 4 minus -12?",
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": "What is -3 multiplied by 25?",
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": "What is 33 divided by -3?",
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": "What is 1 plus 1 plus 1?",
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": "What is 1 plus 5 minus -2?",
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": "What is 20 minus 4 minus 13?",
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": "What is 17 minus 6 plus 3?",
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": "What is 2 multiplied by -2 multiplied by 3?",
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": "What is -3 plus 7 multiplied by -2?",
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": "What is -12 divided by 2 divided by -3?",
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": "What is 52 cubed?",
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": "Who is the President of the United States?",
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
- function usage() {
3
+ usage() {
4
4
  echo "Usage: leap.sh <year>" >&2
5
5
  exit 1
6
6
  }
7
7
 
8
- # check number of params
9
- if [ "$#" != 1 ]; then
8
+ # Check number of params
9
+ if [[ "$#" != 1 ]]; then
10
10
  usage
11
11
  fi
12
12
 
13
- # check param is an integer
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 "This is a leap year."
18
+ if [[ $(($1 % 4)) == 0 ]] \
19
+ && [[ $(($1 % 100)) != 0 ]] \
20
+ || [[ $(($1 % 400)) == 0 ]]; then
21
+ echo "true"
22
22
  else
23
- echo "This is not a leap year."
23
+ echo "false"
24
24
  fi
@@ -1,51 +1,35 @@
1
1
  #!/usr/bin/env bats
2
2
 
3
- @test "Leap year should return leap year" {
3
+ @test 'year not divisible by 4: common year' {
4
4
  #skip
5
- run ./leap.sh 1996
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" = "This is not a leap year." ]
8
+ [ "$output" = 'false' ]
17
9
  }
18
10
 
19
- @test 'Non-leap even year should return non-leap year' {
11
+ @test 'year divisible by 4, not divisible by 100: leap year' {
20
12
  skip
21
- run ./leap.sh 1998
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" = "This is not a leap year." ]
16
+ [ "$output" = 'true' ]
33
17
  }
34
18
 
35
- @test 'Fourth century should return leap year' {
19
+ @test 'year divisible by 100, not divisible by 400: common year' {
36
20
  skip
37
- run ./leap.sh 2400
21
+ run ./leap.sh 2100
38
22
 
39
23
  [ "$status" -eq 0 ]
40
- [ "$output" = "This is a leap year." ]
24
+ [ "$output" = 'false' ]
41
25
  }
42
26
 
43
- @test 'Y2K should return leap year' {
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" = "This is a leap year." ]
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" = "Usage: leap.sh <year>" ]
40
+ [ "$output" = 'Usage: leap.sh <year>' ]
57
41
  }
58
42
 
59
- @test 'Too much input should return an error' {
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" = "Usage: leap.sh <year>" ]
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" = "Usage: leap.sh <year>" ]
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" = "Usage: leap.sh <year>" ]
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.1
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,6 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from problem-specifications version 1.1.0
3
+ // Tests adapted from problem-specifications version 1.2.0
4
4
  {[String, Boolean]*} cases => {
5
5
  // paired square brackets
6
6
  ["[]", true],
@@ -1,6 +1,7 @@
1
1
  import ceylon.test { ... }
2
2
 
3
- // Tests adapted from problem-specifications version 1.0.1
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
  ["", ""],