trackler 2.0.5.3 → 2.0.5.4
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/lib/trackler/version.rb +1 -1
- data/tracks/fsharp/exercises/difference-of-squares/HINTS.md +3 -2
- data/tracks/fsharp/exercises/markdown/Example.fs +1 -6
- data/tracks/fsharp/exercises/markdown/Markdown.fs +0 -6
- data/tracks/fsharp/exercises/markdown/MarkdownTest.fs +1 -1
- data/tracks/go/exercises/acronym/acronym_test.go +2 -2
- data/tracks/go/exercises/acronym/example.go +2 -2
- data/tracks/go/exercises/house/house_test.go +10 -16
- data/tracks/rust/config.json +435 -49
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f8cca57f85b5dabaa34b9cb752d0c823feaae46
|
4
|
+
data.tar.gz: 314de611b35a6b245771b861cd7a6c6a0cf2a6d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da99a8648b63bc77112daa9be4506b98d49a4ba9a78c7914565833c46155df72b1973bc192066e7e864d795134775c8acbba2aec07b2204c92debf15aff687d4
|
7
|
+
data.tar.gz: 080cc27639f4d6d57248e088f77a14a04fd363647af1338c528566803697ffbc37e6787e31403e8232e143c4f3890b291367074b819bc30d8f67595f020bc60c
|
data/lib/trackler/version.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
## Hints
|
2
|
-
For this exercise the following F#
|
3
|
-
- [
|
2
|
+
For this exercise the following F# features come in handy:
|
3
|
+
- The [range operator](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/operators.%5B-..-%5D%5B%5Et%5D-function-%5Bfsharp%5D) allows you to succinctly create a range of values.
|
4
|
+
- [List.sumBy](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/list.sumby%5B't,%5Eu%5D-function-%5Bfsharp%5D) is a condensed format to apply a function to a list and then sum the results.
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module Markdown
|
2
2
|
|
3
|
-
open System
|
4
3
|
open System.Text.RegularExpressions
|
5
4
|
|
6
5
|
let openingTag tag = sprintf "<%s>" tag
|
@@ -27,15 +26,11 @@ let parseDelimited delimiter tag (markdown: string) =
|
|
27
26
|
let parseBold = parseDelimited "__" boldTag
|
28
27
|
let parseItalic = parseDelimited "_" italicTag
|
29
28
|
|
30
|
-
let correctLine list (markdown: string) =
|
31
|
-
if list && (startsWithTag boldTag markdown || startsWithTag italicTag markdown) then markdown
|
32
|
-
else wrapInTag paragraphTag markdown
|
33
|
-
|
34
29
|
let parseText list (markdown: string) =
|
35
30
|
markdown
|
36
31
|
|> parseBold
|
37
32
|
|> parseItalic
|
38
|
-
|>
|
33
|
+
|> if list then id else wrapInTag paragraphTag
|
39
34
|
|
40
35
|
let (|Header|_|) (list: bool) (markdown: string) =
|
41
36
|
let headerNumber =
|
@@ -49,14 +49,8 @@ let rec parse (markdown: string) =
|
|
49
49
|
else
|
50
50
|
__pos <- -1
|
51
51
|
|
52
|
-
if not notusep then
|
53
|
-
html <- html + "<p>"
|
54
|
-
|
55
52
|
html <- html + line
|
56
53
|
|
57
|
-
if not notusep then
|
58
|
-
html <- html + "</p>"
|
59
|
-
|
60
54
|
html <- html + "</li>"
|
61
55
|
|
62
56
|
elif lines.[i].[0] = '#' then
|
@@ -49,7 +49,7 @@ let ``With h6 header level`` () =
|
|
49
49
|
[<Test>]
|
50
50
|
let ``Unordered lists`` () =
|
51
51
|
let input = "* Item 1\n* Item 2"
|
52
|
-
let expected = "<ul><li
|
52
|
+
let expected = "<ul><li>Item 1</li><li>Item 2</li></ul>"
|
53
53
|
Assert.That(parse input, Is.EqualTo(expected))
|
54
54
|
|
55
55
|
[<Test>]
|
@@ -4,7 +4,7 @@ import (
|
|
4
4
|
"testing"
|
5
5
|
)
|
6
6
|
|
7
|
-
const targetTestVersion =
|
7
|
+
const targetTestVersion = 2
|
8
8
|
|
9
9
|
type testCase struct {
|
10
10
|
input string
|
@@ -28,7 +28,7 @@ func TestTestVersion(t *testing.T) {
|
|
28
28
|
|
29
29
|
func TestAcronym(t *testing.T) {
|
30
30
|
for _, test := range stringTestCases {
|
31
|
-
actual :=
|
31
|
+
actual := Abbreviate(test.input)
|
32
32
|
if actual != test.expected {
|
33
33
|
t.Errorf("Acronym test [%s], expected [%s], actual [%s]", test.input, test.expected, actual)
|
34
34
|
}
|
@@ -6,9 +6,9 @@ import (
|
|
6
6
|
"strings"
|
7
7
|
)
|
8
8
|
|
9
|
-
const testVersion =
|
9
|
+
const testVersion = 2
|
10
10
|
|
11
|
-
func
|
11
|
+
func Abbreviate(s string) string {
|
12
12
|
regex := regexp.MustCompile("[A-Z]+[a-z]*|[a-z]+")
|
13
13
|
words := regex.FindAllString(s, -1)
|
14
14
|
abbr := []string{}
|
@@ -1,23 +1,17 @@
|
|
1
|
-
// Embed
|
2
|
-
// transitive verb.
|
1
|
+
// Embed places a phrase with another phrase.
|
3
2
|
//
|
4
|
-
//
|
5
|
-
// of the clause. That is, relPhrase consists of a subject, a relative
|
6
|
-
// pronoun, a transitive verb, possibly a preposition, but then no object.
|
7
|
-
//
|
8
|
-
// func Embed(relPhrase, nounPhrase string) string
|
3
|
+
// func Embed(prefixPhrase, suffixPhrase string) string
|
9
4
|
|
10
|
-
// Verse generates a verse
|
11
|
-
// a recursive structure.
|
12
|
-
//
|
13
|
-
// func Verse(subject string, relPhrases []string, nounPhrase string) string
|
5
|
+
// Verse generates a verse with relative phrases that have a recursive structure.
|
14
6
|
//
|
15
|
-
//
|
16
|
-
|
17
|
-
//
|
7
|
+
// func Verse(prefixPhrase string, relPhrases []string, suffixPhrase string) string
|
8
|
+
|
9
|
+
// As ever, there are different ways to do this. Try using Embed as a
|
10
|
+
// subroutine of Verse, and using programmatic recursion to generate the return
|
11
|
+
// value, reflecting the grammatical recursion of the song.
|
18
12
|
|
19
|
-
// Song generates the full text of "The House That Jack Built".
|
20
|
-
// could
|
13
|
+
// Song generates the full text of "The House That Jack Built". Of course, you
|
14
|
+
// could return a string literal, but humor us; try using Verse as a subroutine.
|
21
15
|
//
|
22
16
|
// func Song() string
|
23
17
|
|
data/tracks/rust/config.json
CHANGED
@@ -3,55 +3,441 @@
|
|
3
3
|
"language": "Rust",
|
4
4
|
"repository": "https://github.com/exercism/xrust",
|
5
5
|
"active": true,
|
6
|
-
"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
6
|
+
"exercises": [
|
7
|
+
{
|
8
|
+
"slug": "hello-world",
|
9
|
+
"difficulty": 1,
|
10
|
+
"topics": [
|
11
|
+
"Some/None",
|
12
|
+
"println!"
|
13
|
+
]
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"slug": "gigasecond",
|
17
|
+
"difficulty": 1,
|
18
|
+
"topics": [
|
19
|
+
"crates",
|
20
|
+
"math"
|
21
|
+
]
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"slug": "leap",
|
25
|
+
"difficulty": 1,
|
26
|
+
"topics": [
|
27
|
+
"math",
|
28
|
+
"booleans",
|
29
|
+
"conditionals"
|
30
|
+
]
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"slug": "raindrops",
|
34
|
+
"difficulty": 1,
|
35
|
+
"topics": [
|
36
|
+
"case (or `format`)",
|
37
|
+
"Mutable string"
|
38
|
+
]
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"slug": "bob",
|
42
|
+
"difficulty": 1,
|
43
|
+
"topics": [
|
44
|
+
"chars",
|
45
|
+
"string functions"
|
46
|
+
]
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"slug": "beer-song",
|
50
|
+
"difficulty": 1,
|
51
|
+
"topics": [
|
52
|
+
"case",
|
53
|
+
"string concatenation",
|
54
|
+
"vector (optional)",
|
55
|
+
"loop"
|
56
|
+
]
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"slug": "difference-of-squares",
|
60
|
+
"difficulty": 1,
|
61
|
+
"topics": [
|
62
|
+
"fold",
|
63
|
+
"map"
|
64
|
+
]
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"slug": "grains",
|
68
|
+
"difficulty": 1,
|
69
|
+
"topics": [
|
70
|
+
"math",
|
71
|
+
"panic"
|
72
|
+
]
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"slug": "hamming",
|
76
|
+
"difficulty": 1,
|
77
|
+
"topics": [
|
78
|
+
"Result"
|
79
|
+
]
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"slug": "pascals-triangle",
|
83
|
+
"difficulty": 1,
|
84
|
+
"topics": [
|
85
|
+
"Math",
|
86
|
+
"Vec",
|
87
|
+
"Index (optional)"
|
88
|
+
]
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"slug": "scrabble-score",
|
92
|
+
"difficulty": 1,
|
93
|
+
"topics": [
|
94
|
+
"chaining higher-order functions",
|
95
|
+
"HashMap (optional)"
|
96
|
+
]
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"slug": "pangram",
|
100
|
+
"difficulty": 1,
|
101
|
+
"topics": [
|
102
|
+
"filter",
|
103
|
+
"ascii (optional)"
|
104
|
+
]
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"slug": "nucleotide-count",
|
108
|
+
"difficulty": 1,
|
109
|
+
"topics": [
|
110
|
+
"filter",
|
111
|
+
"entry api",
|
112
|
+
"mutablity",
|
113
|
+
"match"
|
114
|
+
]
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"slug": "largest-series-product",
|
118
|
+
"difficulty": 1,
|
119
|
+
"topics": [
|
120
|
+
"Result",
|
121
|
+
"windows",
|
122
|
+
"higher-order functions",
|
123
|
+
"char"
|
124
|
+
]
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"slug": "word-count",
|
128
|
+
"difficulty": 1,
|
129
|
+
"topics": [
|
130
|
+
"hashmap",
|
131
|
+
"str vs string",
|
132
|
+
"chars",
|
133
|
+
"entry api"
|
134
|
+
]
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"slug": "atbash-cipher",
|
138
|
+
"difficulty": 1,
|
139
|
+
"topics": [
|
140
|
+
"str vs string",
|
141
|
+
"primitive types",
|
142
|
+
"iterators",
|
143
|
+
"chars",
|
144
|
+
"ascii"
|
145
|
+
]
|
146
|
+
},
|
147
|
+
{
|
148
|
+
"slug": "etl",
|
149
|
+
"difficulty": 1,
|
150
|
+
"topics": [
|
151
|
+
"btree"
|
152
|
+
]
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"slug": "acronym",
|
156
|
+
"difficulty": 1,
|
157
|
+
"topics": [
|
158
|
+
"map",
|
159
|
+
"flat_map",
|
160
|
+
"filter",
|
161
|
+
"loops",
|
162
|
+
"Vec"
|
163
|
+
]
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"slug": "sieve",
|
167
|
+
"difficulty": 1,
|
168
|
+
"topics": [
|
169
|
+
"vector",
|
170
|
+
"map",
|
171
|
+
"while let (optional)"
|
172
|
+
]
|
173
|
+
},
|
174
|
+
{
|
175
|
+
"slug": "rna-transcription",
|
176
|
+
"difficulty": 1,
|
177
|
+
"topics": [
|
178
|
+
"match",
|
179
|
+
"struct",
|
180
|
+
"str vs string"
|
181
|
+
]
|
182
|
+
},
|
183
|
+
{
|
184
|
+
"slug": "triangle",
|
185
|
+
"difficulty": 1,
|
186
|
+
"topics": [
|
187
|
+
"Math",
|
188
|
+
"Struct"
|
189
|
+
]
|
190
|
+
},
|
191
|
+
{
|
192
|
+
"slug": "roman-numerals",
|
193
|
+
"difficulty": 1,
|
194
|
+
"topics": [
|
195
|
+
"mutable",
|
196
|
+
"results",
|
197
|
+
"loops",
|
198
|
+
"struct",
|
199
|
+
"traits"
|
200
|
+
]
|
201
|
+
},
|
202
|
+
{
|
203
|
+
"slug": "all-your-base",
|
204
|
+
"difficulty": 1,
|
205
|
+
"topics": [
|
206
|
+
"Result",
|
207
|
+
"enumerate",
|
208
|
+
"fold",
|
209
|
+
"map"
|
210
|
+
]
|
211
|
+
},
|
212
|
+
{
|
213
|
+
"slug": "grade-school",
|
214
|
+
"difficulty": 1,
|
215
|
+
"topics": [
|
216
|
+
"struct",
|
217
|
+
"entry api",
|
218
|
+
"Vec",
|
219
|
+
"Option"
|
220
|
+
]
|
221
|
+
},
|
222
|
+
{
|
223
|
+
"slug": "robot-simulator",
|
224
|
+
"difficulty": 1,
|
225
|
+
"topics": [
|
226
|
+
"Immutability",
|
227
|
+
"enum"
|
228
|
+
]
|
229
|
+
},
|
230
|
+
{
|
231
|
+
"slug": "bracket-push",
|
232
|
+
"difficulty": 1,
|
233
|
+
"topics": [
|
234
|
+
"From trait",
|
235
|
+
"stack or recursion"
|
236
|
+
]
|
237
|
+
},
|
238
|
+
{
|
239
|
+
"slug": "queen-attack",
|
240
|
+
"difficulty": 1,
|
241
|
+
"topics": [
|
242
|
+
"struct",
|
243
|
+
"trait (optional)",
|
244
|
+
"Result"
|
245
|
+
]
|
246
|
+
},
|
247
|
+
{
|
248
|
+
"slug": "bowling",
|
249
|
+
"difficulty": 1,
|
250
|
+
"topics": [
|
251
|
+
"struct",
|
252
|
+
"Result",
|
253
|
+
"goofy bowling logic"
|
254
|
+
]
|
255
|
+
},
|
256
|
+
{
|
257
|
+
"slug": "sublist",
|
258
|
+
"difficulty": 1,
|
259
|
+
"topics": [
|
260
|
+
"enum",
|
261
|
+
"generic over type"
|
262
|
+
]
|
263
|
+
},
|
264
|
+
{
|
265
|
+
"slug": "space-age",
|
266
|
+
"difficulty": 1,
|
267
|
+
"topics": [
|
268
|
+
"Custom Trait",
|
269
|
+
"From Trait",
|
270
|
+
"Default Trait implementation"
|
271
|
+
]
|
272
|
+
},
|
273
|
+
{
|
274
|
+
"slug": "allergies",
|
275
|
+
"difficulty": 1,
|
276
|
+
"topics": [
|
277
|
+
"struct",
|
278
|
+
"enum",
|
279
|
+
"bitwise (probably)",
|
280
|
+
"vectors",
|
281
|
+
"filter"
|
282
|
+
]
|
283
|
+
},
|
284
|
+
{
|
285
|
+
"slug": "variable-length-quantity",
|
286
|
+
"difficulty": 1,
|
287
|
+
"topics": [
|
288
|
+
"Encodings",
|
289
|
+
"slices",
|
290
|
+
"bitwise",
|
291
|
+
"Result"
|
292
|
+
]
|
293
|
+
},
|
294
|
+
{
|
295
|
+
"slug": "phone-number",
|
296
|
+
"difficulty": 1,
|
297
|
+
"topics": [
|
298
|
+
"option",
|
299
|
+
"format",
|
300
|
+
"unwrap_or",
|
301
|
+
"iters",
|
302
|
+
"match"
|
303
|
+
]
|
304
|
+
},
|
305
|
+
{
|
306
|
+
"slug": "wordy",
|
307
|
+
"difficulty": 1,
|
308
|
+
"topics": [
|
309
|
+
"Result",
|
310
|
+
"string parsing",
|
311
|
+
"operators (optional)"
|
312
|
+
]
|
313
|
+
},
|
314
|
+
{
|
315
|
+
"slug": "tournament",
|
316
|
+
"difficulty": 1,
|
317
|
+
"topics": [
|
318
|
+
"enum",
|
319
|
+
"sorting",
|
320
|
+
"hashmap",
|
321
|
+
"structs"
|
322
|
+
]
|
323
|
+
},
|
324
|
+
{
|
325
|
+
"slug": "custom-set",
|
326
|
+
"difficulty": 1,
|
327
|
+
"topics": [
|
328
|
+
"generic over type",
|
329
|
+
"vector",
|
330
|
+
"equality",
|
331
|
+
"struct"
|
332
|
+
]
|
333
|
+
},
|
334
|
+
{
|
335
|
+
"slug": "alphametics",
|
336
|
+
"difficulty": 1,
|
337
|
+
"topics": [
|
338
|
+
"string parsing",
|
339
|
+
"combinations",
|
340
|
+
"math",
|
341
|
+
"external crates (optional)"
|
342
|
+
]
|
343
|
+
},
|
344
|
+
{
|
345
|
+
"slug": "anagram",
|
346
|
+
"difficulty": 1,
|
347
|
+
"topics": [
|
348
|
+
"lifetimes",
|
349
|
+
"str vs string",
|
350
|
+
"loops",
|
351
|
+
"iter",
|
352
|
+
"vector"
|
353
|
+
]
|
354
|
+
},
|
355
|
+
{
|
356
|
+
"slug": "nucleotide-codons",
|
357
|
+
"difficulty": 1,
|
358
|
+
"topics": [
|
359
|
+
"struct",
|
360
|
+
"hash map",
|
361
|
+
"lifetimes",
|
362
|
+
"Result"
|
363
|
+
]
|
364
|
+
},
|
365
|
+
{
|
366
|
+
"slug": "robot-name",
|
367
|
+
"difficulty": 1,
|
368
|
+
"topics": [
|
369
|
+
"struct",
|
370
|
+
"slices",
|
371
|
+
"randomness",
|
372
|
+
"lifetimes",
|
373
|
+
"self mut"
|
374
|
+
]
|
375
|
+
},
|
376
|
+
{
|
377
|
+
"slug": "ocr-numbers",
|
378
|
+
"difficulty": 1,
|
379
|
+
"topics": [
|
380
|
+
"Lines",
|
381
|
+
"Chunks",
|
382
|
+
"slices"
|
383
|
+
]
|
384
|
+
},
|
385
|
+
{
|
386
|
+
"slug": "minesweeper",
|
387
|
+
"difficulty": 1,
|
388
|
+
"topics": [
|
389
|
+
"Board state"
|
390
|
+
]
|
391
|
+
},
|
392
|
+
{
|
393
|
+
"slug": "dominoes",
|
394
|
+
"difficulty": 1,
|
395
|
+
"topics": [
|
396
|
+
"Graph theory",
|
397
|
+
"searching"
|
398
|
+
]
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"slug": "parallel-letter-frequency",
|
402
|
+
"difficulty": 1,
|
403
|
+
"topics": [
|
404
|
+
"multi-threading"
|
405
|
+
]
|
406
|
+
},
|
407
|
+
{
|
408
|
+
"slug": "rectangles",
|
409
|
+
"difficulty": 1,
|
410
|
+
"topics": [
|
411
|
+
"Enum",
|
412
|
+
"structs",
|
413
|
+
"traits",
|
414
|
+
"Lifetimes"
|
415
|
+
]
|
416
|
+
},
|
417
|
+
{
|
418
|
+
"slug": "forth",
|
419
|
+
"difficulty": 1,
|
420
|
+
"topics": [
|
421
|
+
"Parser reimplementation"
|
422
|
+
]
|
423
|
+
},
|
424
|
+
{
|
425
|
+
"slug": "circular-buffer",
|
426
|
+
"difficulty": 1,
|
427
|
+
"topics": [
|
428
|
+
"Buffer reimplementation",
|
429
|
+
"Generics"
|
430
|
+
]
|
431
|
+
},
|
432
|
+
{
|
433
|
+
"slug": "react",
|
434
|
+
"difficulty": 1,
|
435
|
+
"topics": [
|
436
|
+
"Lifetimes",
|
437
|
+
"generics",
|
438
|
+
"closures"
|
439
|
+
]
|
440
|
+
}
|
55
441
|
],
|
56
442
|
"deprecated": [
|
57
443
|
"hexadecimal"
|