trackler 2.2.1.106 → 2.2.1.107

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/delphi/exercises/bowling/uBowlingExample.pas +31 -4
  4. data/tracks/delphi/exercises/bowling/uBowlingTests.pas +81 -5
  5. data/tracks/elm/config/exercise_readme.go.tmpl +29 -4
  6. data/tracks/elm/exercises/accumulate/README.md +0 -3
  7. data/tracks/elm/exercises/all-your-base/README.md +0 -1
  8. data/tracks/elm/exercises/allergies/README.md +0 -1
  9. data/tracks/elm/exercises/atbash-cipher/README.md +2 -1
  10. data/tracks/elm/exercises/etl/README.md +3 -1
  11. data/tracks/elm/exercises/grade-school/README.md +0 -1
  12. data/tracks/elm/exercises/grains/README.md +0 -1
  13. data/tracks/elm/exercises/leap/README.md +1 -1
  14. data/tracks/elm/exercises/list-ops/README.md +0 -1
  15. data/tracks/elm/exercises/nucleotide-count/README.md +8 -22
  16. data/tracks/elm/exercises/pangram/README.md +1 -1
  17. data/tracks/elm/exercises/pascals-triangle/README.md +1 -1
  18. data/tracks/elm/exercises/phone-number/README.md +4 -3
  19. data/tracks/elm/exercises/rna-transcription/README.md +2 -2
  20. data/tracks/elm/exercises/roman-numerals/README.md +1 -1
  21. data/tracks/elm/exercises/run-length-encoding/README.md +4 -4
  22. data/tracks/elm/exercises/scrabble-score/README.md +3 -1
  23. data/tracks/elm/exercises/space-age/README.md +1 -1
  24. data/tracks/elm/exercises/sublist/README.md +0 -1
  25. data/tracks/elm/exercises/sum-of-multiples/README.md +3 -6
  26. data/tracks/elm/exercises/triangle/README.md +9 -6
  27. data/tracks/elm/exercises/word-count/README.md +1 -2
  28. data/tracks/go/config.json +12 -0
  29. data/tracks/go/exercises/forth/.meta/gen.go +5 -3
  30. data/tracks/go/exercises/forth/cases_test.go +2 -2
  31. data/tracks/go/exercises/grains/.meta/gen.go +10 -8
  32. data/tracks/go/exercises/grains/cases_test.go +2 -2
  33. data/tracks/go/exercises/isogram/.meta/gen.go +5 -3
  34. data/tracks/go/exercises/isogram/cases_test.go +2 -2
  35. data/tracks/go/exercises/proverb/.meta/gen.go +51 -0
  36. data/tracks/go/exercises/proverb/README.md +41 -0
  37. data/tracks/go/exercises/proverb/cases_test.go +44 -0
  38. data/tracks/go/exercises/proverb/example.go +19 -0
  39. data/tracks/go/exercises/proverb/proverb.go +15 -0
  40. data/tracks/go/exercises/proverb/proverb_test.go +23 -0
  41. data/tracks/julia/exercises/isbn-verifier/example.jl +2 -0
  42. data/tracks/julia/exercises/isbn-verifier/runtests.jl +4 -4
  43. data/tracks/rust/exercises/two-bucket/README.md +1 -1
  44. data/tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala +17 -15
  45. data/tracks/scala/exercises/change/src/test/scala/ChangeTest.scala +2 -2
  46. data/tracks/scala/exercises/collatz-conjecture/src/test/scala/CollatzConjectureTest.scala +2 -2
  47. data/tracks/scala/exercises/connect/src/test/scala/ConnectTest.scala +1 -1
  48. data/tracks/scala/exercises/crypto-square/src/test/scala/CryptoSquareTest.scala +20 -41
  49. data/tracks/scala/exercises/custom-set/src/test/scala/CustomSetTest.scala +58 -40
  50. data/tracks/scala/exercises/difference-of-squares/src/test/scala/DifferenceOfSquaresTest.scala +1 -1
  51. data/tracks/scala/testgen/src/main/scala/BracketPushTestGenerator.scala +1 -1
  52. data/tracks/scala/testgen/src/main/scala/ChangeTestGenerator.scala +3 -3
  53. data/tracks/scala/testgen/src/main/scala/CollatzConjectureTestGenerator.scala +3 -3
  54. data/tracks/scala/testgen/src/main/scala/ConnectTestGenerator.scala +6 -6
  55. data/tracks/scala/testgen/src/main/scala/CryptoSquareTestGenerator.scala +1 -1
  56. data/tracks/scala/testgen/src/main/scala/CustomSetTestGenerator.scala +32 -26
  57. data/tracks/scala/testgen/src/main/scala/DifferenceOfSquaresTestGenerator.scala +1 -1
  58. metadata +8 -3
  59. data/tracks/elm/docs/EXERCISE_README_INSERT.md +0 -28
@@ -1,4 +1,4 @@
1
- # Pascals Triangle
1
+ # Pascal's Triangle
2
2
 
3
3
  Compute Pascal's triangle up to a given number of rows.
4
4
 
@@ -6,14 +6,15 @@ The **North American Numbering Plan (NANP)** is a telephone numbering system use
6
6
 
7
7
  NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number. The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*.
8
8
 
9
-
10
9
  The format is usually represented as
11
- ```
10
+
11
+ ```text
12
12
  (NXX)-NXX-XXXX
13
13
  ```
14
+
14
15
  where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
15
16
 
16
- Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
17
+ Your task is to clean up differently formatted telephone numbers by removing punctuation and the country code (1) if present.
17
18
 
18
19
  For example, the inputs
19
20
  - `+1 (613)-995-0253`
@@ -1,4 +1,4 @@
1
- # Rna Transcription
1
+ # RNA Transcription
2
2
 
3
3
  Given a DNA strand, return its RNA complement (per RNA transcription).
4
4
 
@@ -49,7 +49,7 @@ calls from each test until you get them all passing!
49
49
 
50
50
  ## Source
51
51
 
52
- Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna)
52
+ Hyperphysics [http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html](http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html)
53
53
 
54
54
  ## Submitting Incomplete Solutions
55
55
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -14,7 +14,7 @@ The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice
14
14
  these letters have lots of straight lines and are hence easy to hack
15
15
  into stone tablets).
16
16
 
17
- ```
17
+ ```text
18
18
  1 => I
19
19
  10 => X
20
20
  7 => VII
@@ -7,20 +7,20 @@ Run-length encoding (RLE) is a simple form of data compression, where runs
7
7
 
8
8
  For example we can represent the original 53 characters with only 13.
9
9
 
10
- ```
10
+ ```text
11
11
  "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB" -> "12WB12W3B24WB"
12
12
  ```
13
13
 
14
14
  RLE allows the original data to be perfectly reconstructed from
15
15
  the compressed data, which makes it a lossless data compression.
16
16
 
17
- ```
17
+ ```text
18
18
  "AABCCCDEEEE" -> "2AB3CD4E" -> "AABCCCDEEEE"
19
19
  ```
20
20
 
21
21
  For simplicity, you can assume that the unencoded string will only contain
22
- the letters A through Z (either lower or upper case) and whitespace. This way
23
- data to be encoded will never contain any numbers and numbers inside data to
22
+ the letters A through Z (either lower or upper case) and whitespace. This way
23
+ data to be encoded will never contain any numbers and numbers inside data to
24
24
  be decoded always represent the count for the following character.
25
25
 
26
26
  ## Elm Installation
@@ -6,7 +6,7 @@ Given a word, compute the scrabble score for that word.
6
6
 
7
7
  You'll need these:
8
8
 
9
- ```plain
9
+ ```text
10
10
  Letter Value
11
11
  A, E, I, O, U, L, N, R, S, T 1
12
12
  D, G 2
@@ -18,6 +18,7 @@ Q, Z 10
18
18
  ```
19
19
 
20
20
  ## Examples
21
+
21
22
  "cabbage" should be scored as worth 14 points:
22
23
 
23
24
  - 3 points for C
@@ -34,6 +35,7 @@ And to total:
34
35
  - = 14
35
36
 
36
37
  ## Extensions
38
+
37
39
  - You can play a double or a triple letter.
38
40
  - You can play a double or a triple word.
39
41
 
@@ -12,7 +12,7 @@ Given an age in seconds, calculate how old someone would be on:
12
12
  - Neptune: orbital period 164.79132 Earth years
13
13
 
14
14
  So if you were told someone were 1,000,000,000 seconds old, you should
15
- be able to say that they're 31 Earth-years old.
15
+ be able to say that they're 31.69 Earth-years old.
16
16
 
17
17
  If you're wondering why Pluto didn't make the cut, go watch [this
18
18
  youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).
@@ -46,6 +46,5 @@ $ npm run watch
46
46
  As you work your way through the test suite, be sure to remove the `skip <|`
47
47
  calls from each test until you get them all passing!
48
48
 
49
-
50
49
  ## Submitting Incomplete Solutions
51
50
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -1,16 +1,13 @@
1
1
  # Sum Of Multiples
2
2
 
3
- Given a number, find the sum of all the multiples of particular numbers up to
3
+ Given a number, find the sum of all the unique multiples of particular numbers up to
4
4
  but not including that number.
5
5
 
6
- If we list all the natural numbers up to but not including 20 that are
7
- multiples of either 3 or 5, we get 3, 5, 6 and 9, 10, 12, 15, and 18.
6
+ If we list all the natural numbers below 20 that are multiples of 3 or 5,
7
+ we get 3, 5, 6, 9, 10, 12, 15, and 18.
8
8
 
9
9
  The sum of these multiples is 78.
10
10
 
11
- Given a number, find the sum of the multiples of a given set of numbers,
12
- up to but not including that number.
13
-
14
11
  ## Elm Installation
15
12
 
16
13
  Refer to the [Exercism help page](http://exercism.io/languages/elm) for Elm
@@ -2,23 +2,26 @@
2
2
 
3
3
  Determine if a triangle is equilateral, isosceles, or scalene.
4
4
 
5
- An _equilateral_ triangle has all three sides the same length.<br/>
5
+ An _equilateral_ triangle has all three sides the same length.
6
+
6
7
  An _isosceles_ triangle has at least two sides the same length. (It is sometimes
7
8
  specified as having exactly two sides the same length, but for the purposes of
8
- this exercise we'll say at least two.)<br/>
9
+ this exercise we'll say at least two.)
10
+
9
11
  A _scalene_ triangle has all sides of different lengths.
10
12
 
11
13
  ## Note
12
14
 
13
- For a shape to be a triangle at all, all sides have to be of length > 0, and
14
- the sum of the lengths of any two sides must be greater than or equal to the
15
+ For a shape to be a triangle at all, all sides have to be of length > 0, and
16
+ the sum of the lengths of any two sides must be greater than or equal to the
15
17
  length of the third side. See [Triangle Inequality](https://en.wikipedia.org/wiki/Triangle_inequality).
16
18
 
17
19
  ## Dig Deeper
18
20
 
19
- The case where the sum of the lengths of two sides _equals_ that of the
20
- third is known as a _degenerate_ triangle - it has zero area and looks like
21
+ The case where the sum of the lengths of two sides _equals_ that of the
22
+ third is known as a _degenerate_ triangle - it has zero area and looks like
21
23
  a single line. Feel free to add your own code/tests to check for degenerate triangles.
24
+
22
25
  ## Elm Installation
23
26
 
24
27
  Refer to the [Exercism help page](http://exercism.io/languages/elm) for Elm
@@ -4,14 +4,13 @@ Given a phrase, count the occurrences of each word in that phrase.
4
4
 
5
5
  For example for the input `"olly olly in come free"`
6
6
 
7
- ```plain
7
+ ```text
8
8
  olly: 2
9
9
  in: 1
10
10
  come: 1
11
11
  free: 1
12
12
  ```
13
13
 
14
-
15
14
  ## Elm Installation
16
15
 
17
16
  Refer to the [Exercism help page](http://exercism.io/languages/elm) for Elm
@@ -1177,6 +1177,18 @@
1177
1177
  "unlocked_by": "luhn",
1178
1178
  "uuid": "37821140-c0d0-4da8-8f50-47356705a615"
1179
1179
  },
1180
+ {
1181
+ "core": false,
1182
+ "difficulty": 4,
1183
+ "slug": "proverb",
1184
+ "topics": [
1185
+ "arrays",
1186
+ "loops",
1187
+ "strings"
1188
+ ],
1189
+ "unlocked_by": "two-fer",
1190
+ "uuid": "b6d05e8f-542b-4789-9cbc-7ba132a5f03d"
1191
+ },
1180
1192
  {
1181
1193
  "difficulty": 2,
1182
1194
  "slug": "isbn-verifier",
@@ -32,8 +32,10 @@ type Group struct {
32
32
  // One test case.
33
33
  type OneCase struct {
34
34
  Description string
35
- Input []string
36
- Expected []int
35
+ Input struct {
36
+ Instructions []string
37
+ }
38
+ Expected []int
37
39
  }
38
40
 
39
41
  // template applied to above data structure generates the Go test cases
@@ -58,7 +60,7 @@ group: {{printf "%q" .Name}},
58
60
  tests: []testCase{
59
61
  {{range .Cases}}{
60
62
  {{printf "%q" .Description}},
61
- {{printf "%#v" .Input}},
63
+ {{printf "%#v" .Input.Instructions}},
62
64
  {{printf "%#v" .Expected}},
63
65
  },
64
66
  {{end}}
@@ -1,8 +1,8 @@
1
1
  package forth
2
2
 
3
3
  // Source: exercism/problem-specifications
4
- // Commit: 9bf041b forth: Add tests for case-insensitivity (#979)
5
- // Problem Specifications Version: 1.4.0
4
+ // Commit: 01257bd forth: Apply new "input" policy
5
+ // Problem Specifications Version: 1.5.0
6
6
 
7
7
  type testGroup struct {
8
8
  group string
@@ -28,29 +28,31 @@ type js struct {
28
28
  type testGroup struct {
29
29
  Description string
30
30
  Cases []json.RawMessage `property:"RAW"`
31
- SquareCases []SquareCase `property:"square"`
31
+ SquareCases []squareCase `property:"square"`
32
32
  // Note: canonical-data.json has a element of "cases"
33
33
  // which includes a test for property 'total', but it is ignored here,
34
34
  // since "expected" is a single known value.
35
35
  }
36
36
 
37
- type SquareCase struct {
37
+ type squareCase struct {
38
38
  Description string
39
- Input int
40
- Expected interface{}
39
+ Input struct {
40
+ Square int
41
+ }
42
+ Expected interface{}
41
43
  }
42
44
 
43
- func (c SquareCase) HasAnswer() bool {
45
+ func (c squareCase) HasAnswer() bool {
44
46
  hasAnswer, _ := determineExpected(c.Expected)
45
47
  return hasAnswer
46
48
  }
47
49
 
48
- func (c SquareCase) Answer() uint64 {
50
+ func (c squareCase) Answer() uint64 {
49
51
  _, answer := determineExpected(c.Expected)
50
52
  return answer
51
53
  }
52
54
 
53
- func (c SquareCase) EditedDescription() string {
55
+ func (c squareCase) EditedDescription() string {
54
56
  // Go doesn't raise exceptions, so replace the wording in .Description.
55
57
  return strings.Replace(c.Description, "raises an exception", "returns an error", 1)
56
58
  }
@@ -85,7 +87,7 @@ var tmpl = `package grains
85
87
  {{- range .SquareCases}}
86
88
  {
87
89
  description: "{{.EditedDescription}}",
88
- input: {{.Input}},
90
+ input: {{.Input.Square}},
89
91
  {{- if .HasAnswer}}
90
92
  expectedVal: {{.Answer}},
91
93
  {{- else}}
@@ -1,8 +1,8 @@
1
1
  package grains
2
2
 
3
3
  // Source: exercism/problem-specifications
4
- // Commit: d4554e6 grains: fix a typo in comments of canonical data
5
- // Problem Specifications Version: 1.0.0
4
+ // Commit: f079c2d grains: Move input (square) to input object (#1191)
5
+ // Problem Specifications Version: 1.1.0
6
6
 
7
7
  // returns the number of grains on the square
8
8
  var squareTests = []struct {
@@ -32,8 +32,10 @@ type js struct {
32
32
  type oneCase struct {
33
33
  Description string
34
34
  Property string
35
- Input string
36
- Expected bool
35
+ Input struct {
36
+ Phrase string
37
+ }
38
+ Expected bool
37
39
  }
38
40
 
39
41
  // Template to generate test cases.
@@ -48,7 +50,7 @@ var testCases = []struct {
48
50
  }{ {{range .J.Cases}} {{range .Cases}}
49
51
  {
50
52
  description: {{printf "%q" .Description}},
51
- input: {{printf "%q" .Input}},
53
+ input: {{printf "%q" .Input.Phrase}},
52
54
  expected: {{printf "%t" .Expected}},
53
55
  },{{end}}{{end}}
54
56
  }
@@ -1,8 +1,8 @@
1
1
  package isogram
2
2
 
3
3
  // Source: exercism/problem-specifications
4
- // Commit: f9e0ebb isogram: Update canonical-data.json as in #919 (#920)
5
- // Problem Specifications Version: 1.2.0
4
+ // Commit: 79f1357 isogram: Apply new "input" policy (#1180)
5
+ // Problem Specifications Version: 1.3.0
6
6
 
7
7
  var testCases = []struct {
8
8
  description string
@@ -0,0 +1,51 @@
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("proverb", &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
+ Cases []struct {
24
+ Description string
25
+ Input struct {
26
+ Strings []string
27
+ }
28
+ Expected []string
29
+ }
30
+ }
31
+
32
+ // template applied to above data structure generates the Go test cases
33
+ var tmpl = `package proverb
34
+
35
+ {{.Header}}
36
+
37
+ type proverbTest struct {
38
+ description string
39
+ input []string
40
+ expected []string
41
+ }
42
+
43
+ var stringTestCases = []proverbTest {
44
+ {{range .J.Cases}} {
45
+ description: {{printf "%q" .Description }},
46
+ input: {{printf "%#v" .Input.Strings }},
47
+ expected: {{printf "%#v" .Expected }},
48
+ },
49
+ {{end}}
50
+ }
51
+ `
@@ -0,0 +1,41 @@
1
+ # Proverb
2
+
3
+ For want of a horseshoe nail, a kingdom was lost, or so the saying goes.
4
+
5
+ Given a list of inputs, generate the relevant proverb. For example, given the list `["nail", "shoe", "horse", "rider", "message", "battle", "kingdom"]`, you will output the full text of this proverbial rhyme:
6
+
7
+ ```text
8
+ For want of a nail the shoe was lost.
9
+ For want of a shoe the horse was lost.
10
+ For want of a horse the rider was lost.
11
+ For want of a rider the message was lost.
12
+ For want of a message the battle was lost.
13
+ For want of a battle the kingdom was lost.
14
+ And all for the want of a nail.
15
+ ```
16
+
17
+ Note that the list of inputs may vary; your solution should be able to handle lists of arbitrary length and content. No line of the output text should be a static, unchanging string; all should vary according to the input given.
18
+
19
+ ## Running the tests
20
+
21
+ To run the tests run the command `go test` from within the exercise directory.
22
+
23
+ If the test suite contains benchmarks, you can run these with the `-bench`
24
+ flag:
25
+
26
+ go test -bench .
27
+
28
+ Keep in mind that each reviewer will run benchmarks on a different machine, with
29
+ different specs, so the results from these benchmark tests may vary.
30
+
31
+ ## Further information
32
+
33
+ For more detailed information about the Go track, including how to get help if
34
+ you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
35
+
36
+ ## Source
37
+
38
+ Wikipedia [http://en.wikipedia.org/wiki/For_Want_of_a_Nail](http://en.wikipedia.org/wiki/For_Want_of_a_Nail)
39
+
40
+ ## Submitting Incomplete Solutions
41
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,44 @@
1
+ package proverb
2
+
3
+ // Source: exercism/problem-specifications
4
+ // Commit: e86e97a proverb: apply "input" policy
5
+ // Problem Specifications Version: 1.1.0
6
+
7
+ type proverbTest struct {
8
+ description string
9
+ input []string
10
+ expected []string
11
+ }
12
+
13
+ var stringTestCases = []proverbTest{
14
+ {
15
+ description: "zero pieces",
16
+ input: []string{},
17
+ expected: []string{},
18
+ },
19
+ {
20
+ description: "one piece",
21
+ input: []string{"nail"},
22
+ expected: []string{"And all for the want of a nail."},
23
+ },
24
+ {
25
+ description: "two pieces",
26
+ input: []string{"nail", "shoe"},
27
+ expected: []string{"For want of a nail the shoe was lost.", "And all for the want of a nail."},
28
+ },
29
+ {
30
+ description: "three pieces",
31
+ input: []string{"nail", "shoe", "horse"},
32
+ expected: []string{"For want of a nail the shoe was lost.", "For want of a shoe the horse was lost.", "And all for the want of a nail."},
33
+ },
34
+ {
35
+ description: "full proverb",
36
+ input: []string{"nail", "shoe", "horse", "rider", "message", "battle", "kingdom"},
37
+ expected: []string{"For want of a nail the shoe was lost.", "For want of a shoe the horse was lost.", "For want of a horse the rider was lost.", "For want of a rider the message was lost.", "For want of a message the battle was lost.", "For want of a battle the kingdom was lost.", "And all for the want of a nail."},
38
+ },
39
+ {
40
+ description: "four pieces modernized",
41
+ input: []string{"pin", "gun", "soldier", "battle"},
42
+ expected: []string{"For want of a pin the gun was lost.", "For want of a gun the soldier was lost.", "For want of a soldier the battle was lost.", "And all for the want of a pin."},
43
+ },
44
+ }