trackler 2.0.8.50 → 2.0.8.51

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b20ae176f6c856990f4e8c19aba7f9a57413eb0
4
- data.tar.gz: 9caaf6ade8db9ed4f780f70fe1f00bd7d3db67fd
3
+ metadata.gz: 0528d77340cb5b9a9f02710c583d8b31db8d2669
4
+ data.tar.gz: 1db7cfbbbb6de5313ec61298d8f738f7173406d5
5
5
  SHA512:
6
- metadata.gz: 72764fd62759d31ac5d878b4018ffb622f498301c619a63a7d8969bbc01508197639bc5c2e9ee7f09118b8d254f63ad777109a7f8094f4f8c5a421c6b2ba2862
7
- data.tar.gz: ea4f65efe06b9679130b05197cd1e0f32c09c4f764b487693321ce9d9a999a4ea461c22d3d18cd90b88186761adcd53f0c0c77836e1aa2564ef674b7c08e8650
6
+ metadata.gz: 7deeb0de3270b5d18d9f71046f064e99bc806ffd8d4eb422e446a6fbb3361ea69707266a4e1ce28763ec1869a4d7fb84c53a4a9ff3b3bb9a96354a6491fc885c
7
+ data.tar.gz: a01de83dfdcf46d25ebcaf286db4bcdfc509310b0e91c9345207a6957e6ae0855286e739c4f7832264d86fbfbcd046c8ac38b8c8830d96193cfd597abde8a144
@@ -3,7 +3,7 @@
3
3
  "comments": [
4
4
  "An isogram is a word or phrase without a repeating letter."
5
5
  ],
6
- "version": "1.0.0",
6
+ "version": "1.1.0",
7
7
  "cases": [
8
8
  {
9
9
  "description": "Check if the given string is an isogram",
@@ -58,6 +58,12 @@
58
58
  "property": "isIsogram",
59
59
  "input": "Emily Jung Schwartzkopf",
60
60
  "expected": true
61
+ },
62
+ {
63
+ "description": "duplicated character in the middle",
64
+ "property": "isIsogram",
65
+ "input": "accentor",
66
+ "expected": false
61
67
  }
62
68
  ]
63
69
  }
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.0.8.50"
2
+ VERSION = "2.0.8.51"
3
3
  end
@@ -129,6 +129,13 @@
129
129
  "topics": [
130
130
  "arithmetics"
131
131
  ]
132
+ },
133
+ {
134
+ "slug": "diamond",
135
+ "difficulty": 1,
136
+ "topics": [
137
+ "strings"
138
+ ]
132
139
  }
133
140
  ],
134
141
  "deprecated": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "hello-world",
2
+ "name": "accumulate",
3
3
  "ignore": [
4
4
  "**/.*",
5
5
  "node_modules",
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "diamond",
3
+ "ignore": [
4
+ "**/.*",
5
+ "node_modules",
6
+ "bower_components",
7
+ "output"
8
+ ],
9
+ "dependencies": {
10
+ "purescript-prelude": "^3.0.0",
11
+ "purescript-enums": "^3.0.0"
12
+ },
13
+ "devDependencies": {
14
+ "purescript-psci-support": "^3.0.0",
15
+ "purescript-test-unit": "^11.0.0"
16
+ }
17
+ }
@@ -0,0 +1,29 @@
1
+ module Diamond
2
+ (rows
3
+ ) where
4
+
5
+ import Prelude
6
+ import Data.Array (drop, replicate, reverse)
7
+ import Data.Char (toCharCode)
8
+ import Data.Enum (enumFromTo)
9
+ import Data.String (fromCharArray, singleton)
10
+
11
+ spaces :: Int -> String
12
+ spaces width = fromCharArray $ replicate width ' '
13
+
14
+ mkRow :: Int -> Char -> String
15
+ mkRow width 'A' = spaces width <> "A" <> spaces width
16
+ mkRow width ch = spaces side
17
+ <> singleton ch
18
+ <> spaces mid
19
+ <> singleton ch
20
+ <> spaces side
21
+ where depth = toCharCode ch - toCharCode 'A'
22
+ side = width - depth
23
+ mid = 2 * depth - 1
24
+
25
+ rows :: Char -> Array String
26
+ rows end = map (mkRow width) chars
27
+ where width = toCharCode end - toCharCode 'A'
28
+ top = enumFromTo 'A' end
29
+ chars = top <> (reverse top # drop 1)
@@ -0,0 +1,3 @@
1
+ module Diamond
2
+ (rows
3
+ ) where
@@ -0,0 +1,100 @@
1
+ module Test.Main where
2
+
3
+ import Prelude
4
+ import Control.Monad.Eff (Eff)
5
+ import Data.Maybe (Maybe(..))
6
+ import Test.Unit.Assert as Assert
7
+ import Test.Unit (suite, test)
8
+ import Test.Unit.Main (runTest)
9
+ import Diamond (rows)
10
+
11
+ main :: Eff _ Unit
12
+ main = runTest do
13
+ suite "Diamond.rows" do
14
+
15
+ test "Degenerate case with a single 'A' row" $
16
+ Assert.equal [ "A"
17
+ ]
18
+ (rows 'A')
19
+
20
+ test "Degenerate case with no row containing 3 distinct groups of spaces" $
21
+ Assert.equal [ " A "
22
+ , "B B"
23
+ , " A "
24
+ ]
25
+ (rows 'B')
26
+
27
+ test "Smallest non-degenerate case with odd diamond side length" $
28
+ Assert.equal [ " A "
29
+ , " B B "
30
+ , "C C"
31
+ , " B B "
32
+ , " A "
33
+ ]
34
+ (rows 'C')
35
+
36
+ test "Smallest non-degenerate case with even diamond side length" $
37
+ Assert.equal [ " A "
38
+ , " B B "
39
+ , " C C "
40
+ , "D D"
41
+ , " C C "
42
+ , " B B "
43
+ , " A "
44
+ ]
45
+ (rows 'D')
46
+
47
+ test "Largest possible diamond" $
48
+ Assert.equal [ " A "
49
+ , " B B "
50
+ , " C C "
51
+ , " D D "
52
+ , " E E "
53
+ , " F F "
54
+ , " G G "
55
+ , " H H "
56
+ , " I I "
57
+ , " J J "
58
+ , " K K "
59
+ , " L L "
60
+ , " M M "
61
+ , " N N "
62
+ , " O O "
63
+ , " P P "
64
+ , " Q Q "
65
+ , " R R "
66
+ , " S S "
67
+ , " T T "
68
+ , " U U "
69
+ , " V V "
70
+ , " W W "
71
+ , " X X "
72
+ , " Y Y "
73
+ , "Z Z"
74
+ , " Y Y "
75
+ , " X X "
76
+ , " W W "
77
+ , " V V "
78
+ , " U U "
79
+ , " T T "
80
+ , " S S "
81
+ , " R R "
82
+ , " Q Q "
83
+ , " P P "
84
+ , " O O "
85
+ , " N N "
86
+ , " M M "
87
+ , " L L "
88
+ , " K K "
89
+ , " J J "
90
+ , " I I "
91
+ , " H H "
92
+ , " G G "
93
+ , " F F "
94
+ , " E E "
95
+ , " D D "
96
+ , " C C "
97
+ , " B B "
98
+ , " A "
99
+ ]
100
+ (rows 'Z')
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prangram",
2
+ "name": "pangram",
3
3
  "ignore": [
4
4
  "**/.*",
5
5
  "node_modules",
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.8.50
4
+ version: 2.0.8.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
@@ -6627,6 +6627,10 @@ files:
6627
6627
  - tracks/purescript/exercises/bracket-push/examples/src/BracketPush.purs
6628
6628
  - tracks/purescript/exercises/bracket-push/src/BracketPush.purs
6629
6629
  - tracks/purescript/exercises/bracket-push/test/Main.purs
6630
+ - tracks/purescript/exercises/diamond/bower.json
6631
+ - tracks/purescript/exercises/diamond/examples/src/Diamond.purs
6632
+ - tracks/purescript/exercises/diamond/src/Diamond.purs
6633
+ - tracks/purescript/exercises/diamond/test/Main.purs
6630
6634
  - tracks/purescript/exercises/difference-of-squares/bower.json
6631
6635
  - tracks/purescript/exercises/difference-of-squares/examples/src/DifferenceOfSquares.purs
6632
6636
  - tracks/purescript/exercises/difference-of-squares/src/DifferenceOfSquares.purs