trackler 2.0.5.3 → 2.0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2c4897c537ea6d0d1e07f9d60f2144b9e20dcfa
4
- data.tar.gz: d5905ad832fd6d67ee4deb73fc90055395358274
3
+ metadata.gz: 6f8cca57f85b5dabaa34b9cb752d0c823feaae46
4
+ data.tar.gz: 314de611b35a6b245771b861cd7a6c6a0cf2a6d8
5
5
  SHA512:
6
- metadata.gz: 39e0d776ae819ac7c800cd3628f5b48464360dd1f1c5816fbc2d8a9dd854df00d4bdcf30c5fed1860fd2ff20fb137ee5006c6757886d97ea61c3caa17384fe16
7
- data.tar.gz: 9e8540751a3babb28b3696ceffa4c88ae862e26eff5f9b52f9204ae671985fc1b28f6f413b70d5bb0ce86980849a17b1a2fd9181e95fb15bc6e01961eb4c92b0
6
+ metadata.gz: da99a8648b63bc77112daa9be4506b98d49a4ba9a78c7914565833c46155df72b1973bc192066e7e864d795134775c8acbba2aec07b2204c92debf15aff687d4
7
+ data.tar.gz: 080cc27639f4d6d57248e088f77a14a04fd363647af1338c528566803697ffbc37e6787e31403e8232e143c4f3890b291367074b819bc30d8f67595f020bc60c
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.0.5.3"
2
+ VERSION = "2.0.5.4"
3
3
  end
@@ -1,3 +1,4 @@
1
1
  ## Hints
2
- For this exercise the following F# feature comes in handy:
3
- - [Seq.sumBy](https://msdn.microsoft.com/en-us/visualfsharpdocs/conceptual/seq.sumby%5B't,%5Eu%5D-function-%5Bfsharp%5D) is a condensed format to apply a function to a sequence and then sum the results
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
- |> correctLine list
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><p>Item 1</p></li><li><p>Item 2</p></li></ul>"
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 = 1
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 := abbreviate(test.input)
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 = 1
9
+ const testVersion = 2
10
10
 
11
- func abbreviate(s string) string {
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 embeds a noun phrase as the object of relative clause with a
2
- // transitive verb.
1
+ // Embed places a phrase with another phrase.
3
2
  //
4
- // Argument relPhrase is a phrase with a relative clause, minus the object
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 of a song with relative clauses that have
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
- // There are different ways to do this of course, but try using Embed as a
16
- // subroutine and using programmatic recursion that reflects the grammatical
17
- // recursion.
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". Oh yes, you
20
- // could just return a string literal, but humor us; use Verse as a subroutine.
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
 
@@ -3,55 +3,441 @@
3
3
  "language": "Rust",
4
4
  "repository": "https://github.com/exercism/xrust",
5
5
  "active": true,
6
- "problems": [
7
- "hello-world",
8
- "gigasecond",
9
- "leap",
10
- "raindrops",
11
- "bob",
12
- "beer-song",
13
- "difference-of-squares",
14
- "grains",
15
- "hamming",
16
- "pascals-triangle",
17
- "scrabble-score",
18
- "pangram",
19
- "nucleotide-count",
20
- "largest-series-product",
21
- "word-count",
22
- "atbash-cipher",
23
- "etl",
24
- "acronym",
25
- "sieve",
26
- "rna-transcription",
27
- "triangle",
28
- "roman-numerals",
29
- "all-your-base",
30
- "grade-school",
31
- "robot-simulator",
32
- "bracket-push",
33
- "queen-attack",
34
- "bowling",
35
- "sublist",
36
- "space-age",
37
- "allergies",
38
- "variable-length-quantity",
39
- "phone-number",
40
- "wordy",
41
- "tournament",
42
- "custom-set",
43
- "alphametics",
44
- "anagram",
45
- "nucleotide-codons",
46
- "robot-name",
47
- "ocr-numbers",
48
- "minesweeper",
49
- "dominoes",
50
- "parallel-letter-frequency",
51
- "rectangles",
52
- "forth",
53
- "circular-buffer",
54
- "react"
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5.3
4
+ version: 2.0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen