trackler 2.0.8.18 → 2.0.8.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/common/.gitignore +1 -0
  3. data/common/.travis.yml +5 -8
  4. data/common/README.md +18 -5
  5. data/common/exercises/grep/canonical-data.json +290 -269
  6. data/common/exercises/phone-number/canonical-data.json +2 -2
  7. data/common/exercises/pov/canonical-data.json +2 -5
  8. data/common/exercises/roman-numerals/canonical-data.json +112 -74
  9. data/common/exercises/tournament/canonical-data.json +86 -85
  10. data/common/exercises/two-bucket/canonical-data.json +55 -47
  11. data/common/package.json +16 -0
  12. data/common/yarn.lock +195 -0
  13. data/lib/trackler/version.rb +1 -1
  14. data/tracks/c/docs/LEARNING.md +1 -1
  15. data/tracks/c/exercises/space-age/src/example.c +15 -47
  16. data/tracks/c/exercises/space-age/src/example.h +12 -8
  17. data/tracks/c/exercises/space-age/test/test_space_age.c +8 -8
  18. data/tracks/ceylon/docs/TESTS.md +5 -2
  19. data/tracks/ceylon/exercises/TRACK_HINTS.md +5 -2
  20. data/tracks/csharp/.gitignore +0 -4
  21. data/tracks/csharp/.travis.yml +9 -20
  22. data/tracks/csharp/appveyor.yml +2 -4
  23. data/tracks/csharp/build.cake +95 -0
  24. data/tracks/csharp/build.ps1 +189 -0
  25. data/tracks/csharp/build.sh +99 -31
  26. data/tracks/csharp/circle.yml +3 -12
  27. data/tracks/delphi/config.json +8 -0
  28. data/tracks/delphi/exercises/minesweeper/MineSweeper.dpr +60 -0
  29. data/tracks/delphi/exercises/minesweeper/uMineSweeperExample.pas +70 -0
  30. data/tracks/delphi/exercises/minesweeper/uMineSweeperTest.pas +270 -0
  31. data/tracks/dlang/config.json +86 -31
  32. data/tracks/elixir/config.json +7 -0
  33. data/tracks/elixir/exercises/rotational-cipher/example.exs +35 -0
  34. data/tracks/elixir/exercises/rotational-cipher/rotational_cipher.exs +13 -0
  35. data/tracks/elixir/exercises/rotational-cipher/rotational_cipher_test.exs +80 -0
  36. data/tracks/go/exercises/raindrops/raindrops_test.go +4 -1
  37. data/tracks/go/exercises/react/react_test.go +6 -8
  38. data/tracks/go/exercises/rna-transcription/rna_transcription_test.go +4 -1
  39. data/tracks/go/exercises/robot-simulator/robot_simulator_test.go +5 -2
  40. data/tracks/haskell/exercises/allergies/src/Allergies.hs +2 -2
  41. data/tracks/haskell/exercises/atbash-cipher/src/Atbash.hs +2 -2
  42. data/tracks/haskell/exercises/bank-account/src/BankAccount.hs +3 -3
  43. data/tracks/haskell/exercises/binary-search-tree/src/BST.hs +7 -7
  44. data/tracks/haskell/exercises/bowling/src/Bowling.hs +1 -1
  45. data/tracks/haskell/exercises/clock/src/Clock.hs +4 -4
  46. data/tracks/haskell/exercises/connect/src/Connect.hs +1 -1
  47. data/tracks/haskell/exercises/crypto-square/src/CryptoSquare.hs +1 -1
  48. data/tracks/haskell/exercises/custom-set/src/CustomSet.hs +12 -12
  49. data/tracks/haskell/exercises/difference-of-squares/src/Squares.hs +3 -3
  50. data/tracks/haskell/exercises/etl/src/ETL.hs +1 -1
  51. data/tracks/haskell/exercises/forth/src/Forth.hs +2 -2
  52. data/tracks/haskell/exercises/go-counting/src/Counting.hs +2 -2
  53. data/tracks/haskell/exercises/kindergarten-garden/src/Garden.hs +3 -3
  54. data/tracks/haskell/exercises/largest-series-product/src/Series.hs +1 -1
  55. data/tracks/haskell/exercises/lens-person/src/Person.hs +4 -4
  56. data/tracks/julia/.travis.yml +3 -2
  57. data/tracks/ocaml/exercises/all-your-base/test.ml +2 -2
  58. data/tracks/ocaml/exercises/beer-song/test.ml +25 -24
  59. data/tracks/ocaml/exercises/phone-number/test.ml +22 -22
  60. data/tracks/ocaml/exercises/run-length-encoding/test.ml +5 -5
  61. data/tracks/ocaml/exercises/word-count/test.ml +1 -1
  62. data/tracks/ocaml/tools/test-generator/templates/beer-song/template.ml +20 -1
  63. data/tracks/purescript/config.json +7 -0
  64. data/tracks/purescript/exercises/word-count/bower.json +17 -0
  65. data/tracks/purescript/exercises/word-count/examples/src/WordCount.purs +31 -0
  66. data/tracks/purescript/exercises/word-count/src/WordCount.purs +3 -0
  67. data/tracks/purescript/exercises/word-count/test/Main.purs +89 -0
  68. data/tracks/python/exercises/accumulate/accumulate.py +2 -0
  69. data/tracks/python/exercises/acronym/acronym.py +2 -0
  70. data/tracks/python/exercises/allergies/allergies.py +3 -0
  71. data/tracks/python/exercises/allergies/example.py +1 -1
  72. data/tracks/python/exercises/anagram/anagram.py +2 -0
  73. data/tracks/python/exercises/atbash-cipher/atbash_cipher.py +6 -0
  74. data/tracks/python/exercises/beer-song/beer_song.py +6 -0
  75. data/tracks/python/exercises/binary-search/binary_search.py +2 -0
  76. data/tracks/python/exercises/binary/binary.py +2 -0
  77. data/tracks/python/exercises/bob/bob.py +2 -8
  78. data/tracks/python/exercises/bracket-push/bracket_push.py +2 -0
  79. data/tracks/python/exercises/circular-buffer/circular_buffer.py +11 -0
  80. data/tracks/python/exercises/clock/clock.py +3 -0
  81. data/tracks/python/exercises/clock/example.py +1 -1
  82. data/tracks/python/exercises/crypto-square/crypto_square.py +2 -0
  83. data/tracks/python/exercises/diamond/diamond.py +2 -0
  84. data/tracks/python/exercises/difference-of-squares/difference_of_squares.py +10 -0
  85. data/tracks/python/exercises/etl/etl.py +2 -0
  86. data/tracks/python/exercises/flatten-array/flatten_array.py +2 -0
  87. data/tracks/python/exercises/gigasecond/gigasecond.py +2 -0
  88. data/tracks/python/exercises/grade-school/grade_school.py +3 -0
  89. data/tracks/python/exercises/grains/grains.py +6 -0
  90. data/tracks/python/exercises/hamming/hamming.py +2 -0
  91. data/tracks/python/exercises/hello-world/hello_world.py +2 -7
  92. data/tracks/python/exercises/hexadecimal/hexadecimal.py +2 -0
  93. data/tracks/python/exercises/house/house.py +6 -0
  94. data/tracks/python/exercises/kindergarten-garden/kindergarten_garden.py +3 -0
  95. data/tracks/python/exercises/largest-series-product/largest_series_product.py +2 -0
  96. data/tracks/python/exercises/leap/leap.py +2 -0
  97. data/tracks/python/exercises/linked-list/linked_list.py +2 -8
  98. data/tracks/python/exercises/list-ops/list_ops.py +18 -22
  99. data/tracks/python/exercises/luhn/luhn.py +3 -0
  100. data/tracks/python/exercises/matrix/matrix.py +3 -0
  101. data/tracks/python/exercises/meetup/meetup.py +2 -0
  102. data/tracks/python/exercises/minesweeper/minesweeper.py +2 -0
  103. data/tracks/python/exercises/nth-prime/nth_prime.py +2 -0
  104. data/tracks/python/exercises/nucleotide-count/nucleotide_count.py +6 -0
  105. data/tracks/python/exercises/ocr-numbers/ocr_numbers.py +6 -0
  106. data/tracks/python/exercises/ocr-numbers/{ocr_test.py → ocr_numbers_test.py} +0 -0
  107. data/tracks/python/exercises/octal/octal.py +2 -0
  108. data/tracks/python/exercises/palindrome-products/palindrome_products.py +6 -0
  109. data/tracks/python/exercises/pangram/pangram.py +2 -0
  110. data/tracks/python/exercises/pascals-triangle/pascals_triangle.py +10 -0
  111. data/tracks/python/exercises/perfect-numbers/perfect_numbers.py +6 -0
  112. data/tracks/python/exercises/phone-number/phone_number.py +3 -0
  113. data/tracks/python/exercises/pig-latin/pig_latin.py +2 -0
  114. data/tracks/python/exercises/point-mutations/point_mutations.py +2 -0
  115. data/tracks/python/exercises/poker/poker.py +2 -0
  116. data/tracks/python/exercises/prime-factors/prime_factors.py +2 -0
  117. data/tracks/python/exercises/proverb/proverb.py +2 -0
  118. data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet.py +10 -0
  119. data/tracks/python/exercises/queen-attack/queen_attack.py +6 -0
  120. data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher.py +10 -0
  121. data/tracks/python/exercises/raindrops/raindrops.py +2 -0
  122. data/tracks/python/exercises/rectangles/example.py +1 -1
  123. data/tracks/python/exercises/rectangles/rectangles.py +2 -0
  124. data/tracks/python/exercises/rectangles/{rectangles_count_test.py → rectangles_test.py} +0 -0
  125. data/tracks/python/exercises/rna-transcription/rna_transcription.py +2 -0
  126. data/tracks/python/exercises/robot-name/robot_name.py +3 -0
  127. data/tracks/python/exercises/robot-simulator/robot_simulator.py +3 -0
  128. data/tracks/python/exercises/roman-numerals/roman_numerals.py +2 -0
  129. data/tracks/python/exercises/run-length-encoding/run_length_encoding.py +6 -0
  130. data/tracks/python/exercises/run-length-encoding/{run_length_test.py → run_length_encoding_test.py} +1 -1
  131. data/tracks/python/exercises/saddle-points/saddle_points.py +2 -0
  132. data/tracks/python/exercises/say/example.py +1 -1
  133. data/tracks/python/exercises/say/say.py +2 -0
  134. data/tracks/python/exercises/say/say_test.py +3 -0
  135. data/tracks/python/exercises/scrabble-score/scrabble_score.py +2 -0
  136. data/tracks/python/exercises/secret-handshake/secret_handshake.py +6 -0
  137. data/tracks/python/exercises/secret-handshake/{handshake_test.py → secret_handshake_test.py} +0 -0
  138. data/tracks/python/exercises/series/series.py +2 -0
  139. data/tracks/python/exercises/sieve/sieve.py +2 -0
  140. data/tracks/python/exercises/simple-cipher/example.py +1 -1
  141. data/tracks/python/exercises/simple-cipher/simple_cipher.py +8 -0
  142. data/tracks/python/exercises/space-age/space_age.py +3 -0
  143. data/tracks/python/exercises/strain/strain.py +6 -0
  144. data/tracks/python/exercises/sublist/sublist.py +2 -0
  145. data/tracks/python/exercises/sum-of-multiples/sum_of_multiples.py +2 -0
  146. data/tracks/python/exercises/triangle/triangle.py +7 -0
  147. data/tracks/python/exercises/trinary/trinary.py +2 -0
  148. data/tracks/python/exercises/twelve-days/twelve_days.py +10 -0
  149. data/tracks/python/exercises/word-count/word_count.py +2 -0
  150. data/tracks/python/exercises/wordy/wordy.py +2 -0
  151. data/tracks/python/exercises/zebra-puzzle/zebra_puzzle.py +2 -0
  152. data/tracks/ruby/exercises/beer-song/.meta/.version +1 -0
  153. data/tracks/ruby/exercises/beer-song/beer_song_test.rb +62 -36
  154. data/tracks/ruby/exercises/beer-song/example.rb +1 -5
  155. data/tracks/ruby/exercises/beer-song/example.tt +22 -0
  156. data/tracks/ruby/lib/beer_song_cases.rb +43 -0
  157. data/tracks/swift/exercises/matrix/Tests/MatrixTests/MatrixTests.swift +1 -1
  158. metadata +94 -13
  159. data/common/bin/jsonlint +0 -27
  160. data/tracks/csharp/.paket/paket.bootstrapper.exe +0 -0
  161. data/tracks/csharp/Zipper.cs +0 -137
  162. data/tracks/csharp/build.cmd +0 -14
  163. data/tracks/csharp/build.fsx +0 -78
  164. data/tracks/csharp/paket.dependencies +0 -2
  165. data/tracks/csharp/paket.lock +0 -3
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "exercise": "phone-number",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "cases": [
5
5
  {
6
6
  "description": "Cleanup user-entered phone numbers",
@@ -47,7 +47,7 @@
47
47
  "expected": "1234567890"
48
48
  },
49
49
  {
50
- "description": "invalid when 12 digits",
50
+ "description": "invalid when more than 11 digits",
51
51
  "property": "clean",
52
52
  "phrase": "321234567890",
53
53
  "expected": null
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "exercise": "pov",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "cases": [{
5
5
  "description": "Reroot a tree so that its root is the specified node.",
6
6
  "comments": [
7
7
  "In this way, the tree is presented from the point of view of the specified node.",
8
- "The input trees used here are those in the `trees` section of this file.",
9
8
  "",
10
9
  "If appropriate for your track, you may test that the input tree is not modified.",
11
10
  "",
@@ -308,9 +307,7 @@
308
307
  "comments": [
309
308
  "A typical implementation would first reroot the tree on one of the two nodes.",
310
309
  "",
311
- "If appropriate for your track, you may test that the input tree is not modified.",
312
- "",
313
- "The trees used here are those in the `trees` section of this file."
310
+ "If appropriate for your track, you may test that the input tree is not modified."
314
311
  ],
315
312
  "cases": [
316
313
  {
@@ -1,76 +1,114 @@
1
1
  {
2
- "cases": [
3
- {
4
- "number" : 1,
5
- "expected": "I"
6
- },
7
- {
8
- "number" : 2,
9
- "expected": "II"
10
- },
11
- {
12
- "number" : 3,
13
- "expected": "III"
14
- },
15
- {
16
- "number" : 4,
17
- "expected": "IV"
18
- },
19
- {
20
- "number" : 5,
21
- "expected": "V"
22
- },
23
- {
24
- "number" : 6,
25
- "expected": "VI"
26
- },
27
- {
28
- "number" : 9,
29
- "expected": "IX"
30
- },
31
- {
32
- "number" : 27,
33
- "expected": "XXVII"
34
- },
35
- {
36
- "number" : 48,
37
- "expected": "XLVIII"
38
- },
39
- {
40
- "number" : 59,
41
- "expected": "LIX"
42
- },
43
- {
44
- "number" : 93,
45
- "expected": "XCIII"
46
- },
47
- {
48
- "number" : 141,
49
- "expected": "CXLI"
50
- },
51
- {
52
- "number" : 163,
53
- "expected": "CLXIII"
54
- },
55
- {
56
- "number" : 402,
57
- "expected": "CDII"
58
- },
59
- {
60
- "number" : 575,
61
- "expected": "DLXXV"
62
- },
63
- {
64
- "number" : 911,
65
- "expected": "CMXI"
66
- },
67
- {
68
- "number" : 1024,
69
- "expected": "MXXIV"
70
- },
71
- {
72
- "number" : 3000,
73
- "expected": "MMM"
74
- }
75
- ]
2
+ "exercise": "roman-numerals",
3
+ "version": "1.0.0",
4
+ "cases": [
5
+ {
6
+ "description": "1 is a single I",
7
+ "property": "roman",
8
+ "number": 1,
9
+ "expected": "I"
10
+ },
11
+ {
12
+ "description": "2 is two I's",
13
+ "property": "roman",
14
+ "number": 2,
15
+ "expected": "II"
16
+ },
17
+ {
18
+ "description": "3 is three I's",
19
+ "property": "roman",
20
+ "number": 3,
21
+ "expected": "III"
22
+ },
23
+ {
24
+ "description": "4, being 5 - 1, is IV",
25
+ "property": "roman",
26
+ "number": 4,
27
+ "expected": "IV"
28
+ },
29
+ {
30
+ "description": "5 is a single V",
31
+ "property": "roman",
32
+ "number": 5,
33
+ "expected": "V"
34
+ },
35
+ {
36
+ "description": "6, being 5 + 1, is VI",
37
+ "property": "roman",
38
+ "number": 6,
39
+ "expected": "VI"
40
+ },
41
+ {
42
+ "description": "9, being 10 - 1, is IX",
43
+ "property": "roman",
44
+ "number": 9,
45
+ "expected": "IX"
46
+ },
47
+ {
48
+ "description": "20 is two X's",
49
+ "property": "roman",
50
+ "number": 27,
51
+ "expected": "XXVII"
52
+ },
53
+ {
54
+ "description": "48 is not 50 - 2 but rather 40 + 8",
55
+ "property": "roman",
56
+ "number": 48,
57
+ "expected": "XLVIII"
58
+ },
59
+ {
60
+ "description": "50 is a single L",
61
+ "property": "roman",
62
+ "number": 59,
63
+ "expected": "LIX"
64
+ },
65
+ {
66
+ "description": "90, being 100 - 10, is XC",
67
+ "property": "roman",
68
+ "number": 93,
69
+ "expected": "XCIII"
70
+ },
71
+ {
72
+ "description": "100 is a single C",
73
+ "property": "roman",
74
+ "number": 141,
75
+ "expected": "CXLI"
76
+ },
77
+ {
78
+ "description": "60, being 50 + 10, is LX",
79
+ "property": "roman",
80
+ "number": 163,
81
+ "expected": "CLXIII"
82
+ },
83
+ {
84
+ "description": "400, being 500 - 100, is CD",
85
+ "property": "roman",
86
+ "number": 402,
87
+ "expected": "CDII"
88
+ },
89
+ {
90
+ "description": "500 is a single D",
91
+ "property": "roman",
92
+ "number": 575,
93
+ "expected": "DLXXV"
94
+ },
95
+ {
96
+ "description": "900, being 1000 - 100, is CM",
97
+ "property": "roman",
98
+ "number": 911,
99
+ "expected": "CMXI"
100
+ },
101
+ {
102
+ "description": "1000 is a single M",
103
+ "property": "roman",
104
+ "number": 1024,
105
+ "expected": "MXXIV"
106
+ },
107
+ {
108
+ "description": "3000 is three M's",
109
+ "property": "roman",
110
+ "number": 3000,
111
+ "expected": "MMM"
112
+ }
113
+ ]
76
114
  }
@@ -1,88 +1,89 @@
1
1
  {
2
- "#": [
3
- "The inputs and outputs are represented as arrays of strings to improve readability in this JSON file.",
4
- "Your track may choose whether to present the input as a single string (concatenating all the lines) or as the list.",
5
- "In most cases, it seems to make sense to expect the output as a single string."
2
+ "exercise": "tournament",
3
+ "version": "1.1.0",
4
+ "comments": [
5
+ "The inputs and outputs are represented as arrays of strings to",
6
+ "improve readability in this JSON file.",
7
+ "Your track may choose whether to present the input as a single",
8
+ "string (concatenating all the lines) or as the list.",
9
+ "In most cases, it seems to make sense to expect the output as",
10
+ "a single string."
6
11
  ],
7
- "valid_inputs": {
8
- "cases": [
9
- {
10
- "description": "typical input",
11
- "input": [
12
- "Allegoric Alaskans;Blithering Badgers;win",
13
- "Devastating Donkeys;Courageous Californians;draw",
14
- "Devastating Donkeys;Allegoric Alaskans;win",
15
- "Courageous Californians;Blithering Badgers;loss",
16
- "Blithering Badgers;Devastating Donkeys;loss",
17
- "Allegoric Alaskans;Courageous Californians;win"
18
- ],
19
- "expected": [
20
- "Team | MP | W | D | L | P",
21
- "Devastating Donkeys | 3 | 2 | 1 | 0 | 7",
22
- "Allegoric Alaskans | 3 | 2 | 0 | 1 | 6",
23
- "Blithering Badgers | 3 | 1 | 0 | 2 | 3",
24
- "Courageous Californians | 3 | 0 | 1 | 2 | 1"
25
- ]
26
- },
27
- {
28
- "description": "incomplete competition (not all pairs have played)",
29
- "input": [
30
- "Allegoric Alaskans;Blithering Badgers;loss",
31
- "Devastating Donkeys;Allegoric Alaskans;loss",
32
- "Courageous Californians;Blithering Badgers;draw",
33
- "Allegoric Alaskans;Courageous Californians;win"
34
- ],
35
- "expected": [
36
- "Team | MP | W | D | L | P",
37
- "Allegoric Alaskans | 3 | 2 | 0 | 1 | 6",
38
- "Blithering Badgers | 2 | 1 | 1 | 0 | 4",
39
- "Courageous Californians | 2 | 0 | 1 | 1 | 1",
40
- "Devastating Donkeys | 1 | 0 | 0 | 1 | 0"
41
- ]
42
- },
43
- {
44
- "description": "ties broken alphabetically",
45
- "input": [
46
- "Courageous Californians;Devastating Donkeys;win",
47
- "Allegoric Alaskans;Blithering Badgers;win",
48
- "Devastating Donkeys;Allegoric Alaskans;loss",
49
- "Courageous Californians;Blithering Badgers;win",
50
- "Blithering Badgers;Devastating Donkeys;draw",
51
- "Allegoric Alaskans;Courageous Californians;draw"
52
- ],
53
- "expected": [
54
- "Team | MP | W | D | L | P",
55
- "Allegoric Alaskans | 3 | 2 | 1 | 0 | 7",
56
- "Courageous Californians | 3 | 2 | 1 | 0 | 7",
57
- "Blithering Badgers | 3 | 0 | 1 | 2 | 1",
58
- "Devastating Donkeys | 3 | 0 | 1 | 2 | 1"
59
- ]
60
- }
61
- ]
62
- },
63
- "invalid_lines": {
64
- "#": [
65
- "Your track should test that, for each invalid line,",
66
- "inserting the invalid line into an otherwise-valid game still results in valid output.",
67
- "It's suggested to use one of the valid games above."
68
- ],
69
- "cases": [
70
- {
71
- "description": "an empty line",
72
- "input": ""
73
- },
74
- {
75
- "description": "wrong separator used",
76
- "input": "Devastating Donkeys@Courageous Californians;draw"
77
- },
78
- {
79
- "description": "too many separators",
80
- "input": "Devastating Donkeys;Courageous Californians;draw;5"
81
- },
82
- {
83
- "description": "invalid match result",
84
- "input": "Devastating Donkeys;Allegoric Alaskans;dra"
85
- }
86
- ]
87
- }
12
+ "cases": [
13
+ {
14
+ "description": "typical input",
15
+ "property": "tally",
16
+ "input": [
17
+ "Allegoric Alaskans;Blithering Badgers;win",
18
+ "Devastating Donkeys;Courageous Californians;draw",
19
+ "Devastating Donkeys;Allegoric Alaskans;win",
20
+ "Courageous Californians;Blithering Badgers;loss",
21
+ "Blithering Badgers;Devastating Donkeys;loss",
22
+ "Allegoric Alaskans;Courageous Californians;win"
23
+ ],
24
+ "expected": [
25
+ "Team | MP | W | D | L | P",
26
+ "Devastating Donkeys | 3 | 2 | 1 | 0 | 7",
27
+ "Allegoric Alaskans | 3 | 2 | 0 | 1 | 6",
28
+ "Blithering Badgers | 3 | 1 | 0 | 2 | 3",
29
+ "Courageous Californians | 3 | 0 | 1 | 2 | 1"
30
+ ]
31
+ },
32
+ {
33
+ "description": "incomplete competition (not all pairs have played)",
34
+ "property": "tally",
35
+ "input": [
36
+ "Allegoric Alaskans;Blithering Badgers;loss",
37
+ "Devastating Donkeys;Allegoric Alaskans;loss",
38
+ "Courageous Californians;Blithering Badgers;draw",
39
+ "Allegoric Alaskans;Courageous Californians;win"
40
+ ],
41
+ "expected": [
42
+ "Team | MP | W | D | L | P",
43
+ "Allegoric Alaskans | 3 | 2 | 0 | 1 | 6",
44
+ "Blithering Badgers | 2 | 1 | 1 | 0 | 4",
45
+ "Courageous Californians | 2 | 0 | 1 | 1 | 1",
46
+ "Devastating Donkeys | 1 | 0 | 0 | 1 | 0"
47
+ ]
48
+ },
49
+ {
50
+ "description": "ties broken alphabetically",
51
+ "property": "tally",
52
+ "input": [
53
+ "Courageous Californians;Devastating Donkeys;win",
54
+ "Allegoric Alaskans;Blithering Badgers;win",
55
+ "Devastating Donkeys;Allegoric Alaskans;loss",
56
+ "Courageous Californians;Blithering Badgers;win",
57
+ "Blithering Badgers;Devastating Donkeys;draw",
58
+ "Allegoric Alaskans;Courageous Californians;draw"
59
+ ],
60
+ "expected": [
61
+ "Team | MP | W | D | L | P",
62
+ "Allegoric Alaskans | 3 | 2 | 1 | 0 | 7",
63
+ "Courageous Californians | 3 | 2 | 1 | 0 | 7",
64
+ "Blithering Badgers | 3 | 0 | 1 | 2 | 1",
65
+ "Devastating Donkeys | 3 | 0 | 1 | 2 | 1"
66
+ ]
67
+ },
68
+ {
69
+ "comments": [
70
+ "Invalid input lines in an otherwise-valid game",
71
+ "still results in valid output."
72
+ ],
73
+ "description": "mostly invalid lines",
74
+ "property": "tally",
75
+ "input": [
76
+ "",
77
+ "Allegoric Alaskans@Blithering Badgers;draw",
78
+ "Blithering Badgers;Devastating Donkeys;loss",
79
+ "Devastating Donkeys;Courageous Californians;win;5",
80
+ "Courageous Californians;Allegoric Alaskans;los"
81
+ ],
82
+ "expected": [
83
+ "Team | MP | W | D | L | P",
84
+ "Devastating Donkeys | 1 | 1 | 0 | 0 | 3",
85
+ "Blithering Badgers | 1 | 0 | 0 | 1 | 0"
86
+ ]
87
+ }
88
+ ]
88
89
  }
@@ -1,50 +1,58 @@
1
1
  {
2
- "two_bucket": {
3
- "cases": [
4
- {
5
- "bucket_one": 3,
6
- "bucket_two": 5,
7
- "goal": 1,
8
- "start_bucket": "one",
9
- "expected": {
10
- "moves": 4,
11
- "goal_bucket": "one",
12
- "other_bucket": 5
13
- }
14
- },
15
- {
16
- "bucket_one": 3,
17
- "bucket_two": 5,
18
- "goal": 1,
19
- "start_bucket": "two",
20
- "expected": {
21
- "moves": 8,
22
- "goal_bucket": "two",
23
- "other_bucket": 3
24
- }
25
- },
26
- {
27
- "bucket_one": 7,
28
- "bucket_two": 11,
29
- "goal": 2,
30
- "start_bucket": "one",
31
- "expected": {
32
- "moves": 14,
33
- "goal_bucket": "one",
34
- "other_bucket": 11
35
- }
36
- },
37
- {
38
- "bucket_one": 7,
39
- "bucket_two": 11,
40
- "goal": 2,
41
- "start_bucket": "two",
42
- "expected": {
43
- "moves": 18,
44
- "goal_bucket": "two",
45
- "other_bucket": 7
46
- }
47
- }
48
- ]
2
+ "exercise": "two-bucket",
3
+ "version": "1.0.1",
4
+ "cases": [
5
+ {
6
+ "description": "Measure using bucket one of size 3 and bucket two of size 5 - start with bucket one",
7
+ "property": "measure",
8
+ "bucket_one": 3,
9
+ "bucket_two": 5,
10
+ "goal": 1,
11
+ "start_bucket": "one",
12
+ "expected": {
13
+ "moves": 4,
14
+ "goal_bucket": "one",
15
+ "other_bucket": 5
16
+ }
17
+ },
18
+ {
19
+ "description": "Measure using bucket one of size 3 and bucket two of size 5 - start with bucket two",
20
+ "property": "measure",
21
+ "bucket_one": 3,
22
+ "bucket_two": 5,
23
+ "goal": 1,
24
+ "start_bucket": "two",
25
+ "expected": {
26
+ "moves": 8,
27
+ "goal_bucket": "two",
28
+ "other_bucket": 3
29
+ }
30
+ },
31
+ {
32
+ "description": "Measure using bucket one of size 7 and bucket two of size 11 - start with bucket one",
33
+ "property": "measure",
34
+ "bucket_one": 7,
35
+ "bucket_two": 11,
36
+ "goal": 2,
37
+ "start_bucket": "one",
38
+ "expected": {
39
+ "moves": 14,
40
+ "goal_bucket": "one",
41
+ "other_bucket": 11
42
+ }
43
+ },
44
+ {
45
+ "description": "Measure using bucket one of size 7 and bucket two of size 11 - start with bucket two",
46
+ "property": "measure",
47
+ "bucket_one": 7,
48
+ "bucket_two": 11,
49
+ "goal": 2,
50
+ "start_bucket": "two",
51
+ "expected": {
52
+ "moves": 18,
53
+ "goal_bucket": "two",
54
+ "other_bucket": 7
55
+ }
49
56
  }
57
+ ]
50
58
  }