trackler 2.1.0.10 → 2.1.0.11
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.
- checksums.yaml +4 -4
- data/bin/bump-content +3 -3
- data/common/README.md +0 -1
- data/common/exercises/kindergarten-garden/canonical-data.json +124 -0
- data/lib/trackler/version.rb +1 -1
- data/tracks/coq/README.md +8 -6
- data/tracks/haskell/exercises/all-your-base/package.yaml +1 -1
- data/tracks/haskell/exercises/allergies/package.yaml +1 -1
- data/tracks/haskell/exercises/alphametics/package.yaml +1 -1
- data/tracks/haskell/exercises/anagram/package.yaml +1 -1
- data/tracks/haskell/exercises/anagram/test/Tests.hs +2 -2
- data/tracks/haskell/exercises/atbash-cipher/package.yaml +1 -1
- data/tracks/haskell/exercises/bob/package.yaml +1 -1
- data/tracks/haskell/exercises/change/package.yaml +1 -1
- data/tracks/haskell/exercises/change/test/Tests.hs +10 -0
- data/tracks/haskell/exercises/clock/package.yaml +1 -1
- data/tracks/haskell/exercises/connect/package.yaml +1 -1
- data/tracks/haskell/exercises/custom-set/package.yaml +1 -1
- data/tracks/haskell/exercises/difference-of-squares/package.yaml +1 -1
- data/tracks/haskell/exercises/dominoes/package.yaml +1 -1
- data/tracks/haskell/exercises/etl/package.yaml +1 -1
- data/tracks/haskell/exercises/forth/package.yaml +1 -1
- data/tracks/haskell/exercises/grains/package.yaml +1 -1
- data/tracks/haskell/exercises/hamming/package.yaml +1 -1
- data/tracks/haskell/exercises/hello-world/package.yaml +1 -1
- data/tracks/haskell/exercises/kindergarten-garden/package.yaml +1 -1
- data/tracks/haskell/exercises/kindergarten-garden/test/Tests.hs +4 -12
- data/tracks/haskell/exercises/largest-series-product/package.yaml +1 -1
- data/tracks/haskell/exercises/largest-series-product/test/Tests.hs +4 -31
- data/tracks/haskell/exercises/meetup/package.yaml +1 -1
- data/tracks/haskell/exercises/minesweeper/package.yaml +1 -1
- data/tracks/haskell/exercises/nth-prime/package.yaml +1 -1
- data/tracks/haskell/exercises/nucleotide-count/package.yaml +1 -1
- data/tracks/haskell/exercises/ocr-numbers/package.yaml +1 -1
- data/tracks/haskell/exercises/pascals-triangle/package.yaml +1 -1
- data/tracks/haskell/exercises/phone-number/package.yaml +1 -1
- data/tracks/haskell/exercises/pig-latin/package.yaml +1 -1
- data/tracks/haskell/exercises/pov/package.yaml +1 -1
- data/tracks/haskell/exercises/prime-factors/package.yaml +1 -1
- data/tracks/haskell/exercises/queen-attack/package.yaml +1 -1
- data/tracks/haskell/exercises/raindrops/package.yaml +1 -1
- data/tracks/haskell/exercises/rna-transcription/package.yaml +1 -1
- data/tracks/haskell/exercises/robot-simulator/package.yaml +1 -1
- data/tracks/haskell/exercises/run-length-encoding/package.yaml +1 -1
- data/tracks/haskell/exercises/run-length-encoding/test/Tests.hs +16 -0
- data/tracks/haskell/exercises/saddle-points/package.yaml +1 -1
- data/tracks/haskell/exercises/saddle-points/test/Tests.hs +8 -8
- data/tracks/haskell/exercises/say/package.yaml +1 -1
- data/tracks/haskell/exercises/scrabble-score/package.yaml +1 -1
- data/tracks/haskell/exercises/secret-handshake/package.yaml +1 -1
- data/tracks/haskell/exercises/sieve/package.yaml +1 -1
- data/tracks/haskell/exercises/space-age/package.yaml +1 -1
- data/tracks/haskell/exercises/sublist/package.yaml +1 -1
- data/tracks/haskell/exercises/sum-of-multiples/package.yaml +1 -1
- data/tracks/haskell/exercises/word-count/package.yaml +1 -1
- data/tracks/haskell/exercises/wordy/package.yaml +1 -1
- data/tracks/java/exercises/binary-search-tree/src/test/java/BSTTest.java +1 -1
- data/tracks/java/exercises/bracket-push/src/test/java/BracketCheckerTest.java +12 -12
- data/tracks/java/exercises/simple-linked-list/src/test/java/SimpleLinkedListTest.java +6 -6
- data/tracks/javascript/SETUP.md +6 -1
- data/tracks/javascript/exercises/hello-world/HINTS.md +2 -2
- data/tracks/ruby/exercises/phone-number/phone_number_test.rb +1 -1
- data/tracks/ruby/exercises/tournament/.meta/.version +1 -1
- data/tracks/ruby/exercises/tournament/example.rb +1 -1
- data/tracks/ruby/exercises/tournament/tournament_test.rb +118 -21
- data/tracks/ruby/lib/tasks/exercise.rb +1 -1
- data/tracks/ruby/test/tasks/exercise_test.rb +4 -2
- data/tracks/rust/exercises/acronym/Cargo.toml +1 -1
- data/tracks/rust/exercises/all-your-base/Cargo.toml +1 -1
- data/tracks/rust/exercises/allergies/Cargo.toml +1 -1
- data/tracks/rust/exercises/alphametics/Cargo.toml +1 -1
- data/tracks/rust/exercises/atbash-cipher/Cargo.toml +1 -1
- data/tracks/rust/exercises/bowling/Cargo.toml +1 -1
- data/tracks/rust/exercises/bracket-push/Cargo.toml +1 -1
- data/tracks/rust/exercises/custom-set/Cargo.toml +1 -1
- data/tracks/rust/exercises/dominoes/Cargo.toml +1 -1
- data/tracks/rust/exercises/gigasecond/Cargo.toml +1 -1
- data/tracks/rust/exercises/grains/Cargo.toml +1 -1
- data/tracks/rust/exercises/hello-world/Cargo.toml +1 -1
- data/tracks/rust/exercises/largest-series-product/Cargo.toml +1 -1
- data/tracks/rust/exercises/leap/Cargo.toml +1 -1
- data/tracks/rust/exercises/pascals-triangle/Cargo.toml +1 -1
- data/tracks/rust/exercises/queen-attack/Cargo.toml +1 -1
- data/tracks/rust/exercises/react/Cargo.toml +1 -1
- data/tracks/rust/exercises/robot-simulator/Cargo.toml +1 -1
- data/tracks/rust/exercises/roman-numerals/Cargo.toml +1 -1
- data/tracks/rust/exercises/rotational-cipher/Cargo.toml +1 -1
- data/tracks/rust/exercises/run-length-encoding/Cargo.lock +1 -1
- data/tracks/rust/exercises/run-length-encoding/Cargo.toml +1 -1
- data/tracks/rust/exercises/scrabble-score/Cargo.toml +1 -1
- data/tracks/rust/exercises/sieve/Cargo.toml +1 -1
- data/tracks/rust/exercises/space-age/Cargo.toml +1 -1
- data/tracks/rust/exercises/sum-of-multiples/Cargo.toml +1 -1
- data/tracks/rust/exercises/variable-length-quantity/Cargo.toml +1 -1
- data/tracks/rust/exercises/wordy/Cargo.toml +1 -1
- data/tracks/typescript/config.json +6 -1
- data/tracks/typescript/exercises/scrabble-score/package.json +36 -0
- data/tracks/typescript/exercises/scrabble-score/scrabble-score.example.ts +26 -0
- data/tracks/typescript/exercises/scrabble-score/scrabble-score.test.ts +16 -0
- data/tracks/typescript/exercises/scrabble-score/tsconfig.json +21 -0
- data/tracks/typescript/exercises/scrabble-score/tslint.json +127 -0
- data/tracks/typescript/exercises/scrabble-score/yarn.lock +2739 -0
- metadata +9 -10
- data/tracks/coq/exercises/hello-world/example.v +0 -3
- data/tracks/coq/exercises/hello-world/hello-world.v +0 -3
- data/tracks/coq/exercises/rna-transcription/DNA.v +0 -4
- data/tracks/coq/exercises/rna-transcription/example.v +0 -15
- data/tracks/coq/exercises/rna-transcription/rna-transcription.v +0 -5
- data/tracks/coq/exercises/tautology/description.md +0 -1
- data/tracks/coq/exercises/tautology/example.v +0 -4
- data/tracks/coq/exercises/tautology/tautology.v +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3
|
|
@@ -2,11 +2,126 @@
|
|
|
2
2
|
require 'minitest/autorun'
|
|
3
3
|
require_relative 'tournament'
|
|
4
4
|
|
|
5
|
-
# Common test data version: 1.
|
|
5
|
+
# Common test data version: 1.3.0 f2042f1
|
|
6
6
|
class TournamentTest < Minitest::Test
|
|
7
|
-
def
|
|
7
|
+
def test_just_the_header_if_no_input
|
|
8
8
|
# skip
|
|
9
9
|
input = <<-INPUT.gsub(/^ */, '')
|
|
10
|
+
|
|
11
|
+
INPUT
|
|
12
|
+
actual = Tournament.tally(input)
|
|
13
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
14
|
+
Team | MP | W | D | L | P
|
|
15
|
+
TALLY
|
|
16
|
+
assert_equal expected, actual
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test_a_win_is_three_points_a_loss_is_zero_points
|
|
20
|
+
skip
|
|
21
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
22
|
+
Allegoric Alaskans;Blithering Badgers;win
|
|
23
|
+
INPUT
|
|
24
|
+
actual = Tournament.tally(input)
|
|
25
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
26
|
+
Team | MP | W | D | L | P
|
|
27
|
+
Allegoric Alaskans | 1 | 1 | 0 | 0 | 3
|
|
28
|
+
Blithering Badgers | 1 | 0 | 0 | 1 | 0
|
|
29
|
+
TALLY
|
|
30
|
+
assert_equal expected, actual
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def test_a_win_can_also_be_expressed_as_a_loss
|
|
34
|
+
skip
|
|
35
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
36
|
+
Blithering Badgers;Allegoric Alaskans;loss
|
|
37
|
+
INPUT
|
|
38
|
+
actual = Tournament.tally(input)
|
|
39
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
40
|
+
Team | MP | W | D | L | P
|
|
41
|
+
Allegoric Alaskans | 1 | 1 | 0 | 0 | 3
|
|
42
|
+
Blithering Badgers | 1 | 0 | 0 | 1 | 0
|
|
43
|
+
TALLY
|
|
44
|
+
assert_equal expected, actual
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def test_a_different_team_can_win
|
|
48
|
+
skip
|
|
49
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
50
|
+
Blithering Badgers;Allegoric Alaskans;win
|
|
51
|
+
INPUT
|
|
52
|
+
actual = Tournament.tally(input)
|
|
53
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
54
|
+
Team | MP | W | D | L | P
|
|
55
|
+
Blithering Badgers | 1 | 1 | 0 | 0 | 3
|
|
56
|
+
Allegoric Alaskans | 1 | 0 | 0 | 1 | 0
|
|
57
|
+
TALLY
|
|
58
|
+
assert_equal expected, actual
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def test_a_draw_is_one_point_each
|
|
62
|
+
skip
|
|
63
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
64
|
+
Allegoric Alaskans;Blithering Badgers;draw
|
|
65
|
+
INPUT
|
|
66
|
+
actual = Tournament.tally(input)
|
|
67
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
68
|
+
Team | MP | W | D | L | P
|
|
69
|
+
Allegoric Alaskans | 1 | 0 | 1 | 0 | 1
|
|
70
|
+
Blithering Badgers | 1 | 0 | 1 | 0 | 1
|
|
71
|
+
TALLY
|
|
72
|
+
assert_equal expected, actual
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def test_there_can_be_more_than_one_match
|
|
76
|
+
skip
|
|
77
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
78
|
+
Allegoric Alaskans;Blithering Badgers;win
|
|
79
|
+
Allegoric Alaskans;Blithering Badgers;win
|
|
80
|
+
INPUT
|
|
81
|
+
actual = Tournament.tally(input)
|
|
82
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
83
|
+
Team | MP | W | D | L | P
|
|
84
|
+
Allegoric Alaskans | 2 | 2 | 0 | 0 | 6
|
|
85
|
+
Blithering Badgers | 2 | 0 | 0 | 2 | 0
|
|
86
|
+
TALLY
|
|
87
|
+
assert_equal expected, actual
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def test_there_can_be_more_than_one_winner
|
|
91
|
+
skip
|
|
92
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
93
|
+
Allegoric Alaskans;Blithering Badgers;loss
|
|
94
|
+
Allegoric Alaskans;Blithering Badgers;win
|
|
95
|
+
INPUT
|
|
96
|
+
actual = Tournament.tally(input)
|
|
97
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
98
|
+
Team | MP | W | D | L | P
|
|
99
|
+
Allegoric Alaskans | 2 | 1 | 0 | 1 | 3
|
|
100
|
+
Blithering Badgers | 2 | 1 | 0 | 1 | 3
|
|
101
|
+
TALLY
|
|
102
|
+
assert_equal expected, actual
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def test_there_can_be_more_than_two_teams
|
|
106
|
+
skip
|
|
107
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
108
|
+
Allegoric Alaskans;Blithering Badgers;win
|
|
109
|
+
Blithering Badgers;Courageous Californians;win
|
|
110
|
+
Courageous Californians;Allegoric Alaskans;loss
|
|
111
|
+
INPUT
|
|
112
|
+
actual = Tournament.tally(input)
|
|
113
|
+
expected = <<-TALLY.gsub(/^ */, '')
|
|
114
|
+
Team | MP | W | D | L | P
|
|
115
|
+
Allegoric Alaskans | 2 | 2 | 0 | 0 | 6
|
|
116
|
+
Blithering Badgers | 2 | 1 | 0 | 1 | 3
|
|
117
|
+
Courageous Californians | 2 | 0 | 0 | 2 | 0
|
|
118
|
+
TALLY
|
|
119
|
+
assert_equal expected, actual
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def test_typical_input
|
|
123
|
+
skip
|
|
124
|
+
input = <<-INPUT.gsub(/^ */, '')
|
|
10
125
|
Allegoric Alaskans;Blithering Badgers;win
|
|
11
126
|
Devastating Donkeys;Courageous Californians;draw
|
|
12
127
|
Devastating Donkeys;Allegoric Alaskans;win
|
|
@@ -65,24 +180,6 @@ TALLY
|
|
|
65
180
|
assert_equal expected, actual
|
|
66
181
|
end
|
|
67
182
|
|
|
68
|
-
def test_mostly_invalid_lines
|
|
69
|
-
skip
|
|
70
|
-
input = <<-INPUT.gsub(/^ */, '')
|
|
71
|
-
|
|
72
|
-
Allegoric Alaskans@Blithering Badgers;draw
|
|
73
|
-
Blithering Badgers;Devastating Donkeys;loss
|
|
74
|
-
Devastating Donkeys;Courageous Californians;win;5
|
|
75
|
-
Courageous Californians;Allegoric Alaskans;los
|
|
76
|
-
INPUT
|
|
77
|
-
actual = Tournament.tally(input)
|
|
78
|
-
expected = <<-TALLY.gsub(/^ */, '')
|
|
79
|
-
Team | MP | W | D | L | P
|
|
80
|
-
Devastating Donkeys | 1 | 1 | 0 | 0 | 3
|
|
81
|
-
Blithering Badgers | 1 | 0 | 0 | 1 | 0
|
|
82
|
-
TALLY
|
|
83
|
-
assert_equal expected, actual
|
|
84
|
-
end
|
|
85
|
-
|
|
86
183
|
# Problems in exercism evolve over time, as we find better ways to ask
|
|
87
184
|
# questions.
|
|
88
185
|
# The version number refers to the version of the problem you solved,
|
|
@@ -102,6 +199,6 @@ TALLY
|
|
|
102
199
|
|
|
103
200
|
def test_bookkeeping
|
|
104
201
|
skip
|
|
105
|
-
assert_equal
|
|
202
|
+
assert_equal 3, BookKeeping::VERSION
|
|
106
203
|
end
|
|
107
204
|
end
|
|
@@ -23,7 +23,7 @@ class Exercise
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def example_file
|
|
26
|
-
File.exist?(example_filename) ? example_filename : legacy_example_filename
|
|
26
|
+
File.exist?(File.join(directory, example_filename)) ? example_filename : legacy_example_filename
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def testable_example_file
|
|
@@ -31,8 +31,10 @@ class ExerciseTest < Minitest::Test
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def test_example_file
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
mock_exist = Minitest::Mock.new
|
|
35
|
+
mock_exist.expect(:call, true, ['exercises/alpha/./.meta/solutions/alpha.rb'])
|
|
36
|
+
File.stub(:exist?, mock_exist) do
|
|
37
|
+
assert_equal '.meta/solutions/alpha.rb', Exercise.new('alpha').example_file
|
|
36
38
|
end
|
|
37
39
|
end
|
|
38
40
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "xtypescript",
|
|
3
|
+
"version": "0",
|
|
4
|
+
"description": "Exercism exercises in Typescript.",
|
|
5
|
+
"author": "",
|
|
6
|
+
"private": true,
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/exercism/xtypescript"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "jest --no-cache",
|
|
14
|
+
"lint": "tslint '*.ts?(x)'; exit 0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/jest": "^18.1.1",
|
|
18
|
+
"@types/node": "^7.0.5",
|
|
19
|
+
"jest": "^19.0.2",
|
|
20
|
+
"ts-jest": "^19.0.0",
|
|
21
|
+
"tslint": "^4.5.1",
|
|
22
|
+
"typescript": "^2.2.1"
|
|
23
|
+
},
|
|
24
|
+
"jest": {
|
|
25
|
+
"transform": {
|
|
26
|
+
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
|
|
27
|
+
},
|
|
28
|
+
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
|
|
29
|
+
"testResultsProcessor": "<rootDir>/node_modules/ts-jest/coverageprocessor.js",
|
|
30
|
+
"moduleFileExtensions": [
|
|
31
|
+
"ts",
|
|
32
|
+
"tsx",
|
|
33
|
+
"js"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface LetterScore {
|
|
2
|
+
[key: string]: number
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
const letterScores: LetterScore = {
|
|
6
|
+
a : 1, e : 1, i : 1, o : 1,
|
|
7
|
+
u : 1, l : 1, n : 1, r : 1,
|
|
8
|
+
s : 1, t : 1, d : 2, g : 2,
|
|
9
|
+
b : 3, c : 3, m : 3, p : 3,
|
|
10
|
+
f : 4, h : 4, v : 4, w : 4,
|
|
11
|
+
y : 4, k : 5, j : 8, x : 8,
|
|
12
|
+
q : 10, z : 10
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const score = (word: string): number => {
|
|
16
|
+
word = word ? word.toLowerCase() : ''
|
|
17
|
+
|
|
18
|
+
let output = 0
|
|
19
|
+
word.split('').forEach((letter: string): void => {
|
|
20
|
+
output += letterScores[letter]
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
return output
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default score
|