trackler 2.2.1.135 → 2.2.1.136
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/pov/canonical-data.json +33 -1
- data/tracks/c/exercises/acronym/test/test_acronym.c +25 -17
- data/tracks/csharp/exercises/binary-search-tree/BinarySearchTreeTest.cs +37 -28
- data/tracks/csharp/generators/Exercises/BinarySearchTree.cs +69 -0
- data/tracks/haskell/config.json +1 -0
- data/tracks/haskell/exercises/accumulate/package.yaml +1 -1
- data/tracks/haskell/exercises/acronym/package.yaml +1 -1
- 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/atbash-cipher/package.yaml +1 -1
- data/tracks/haskell/exercises/bank-account/package.yaml +1 -1
- data/tracks/haskell/exercises/beer-song/package.yaml +1 -1
- data/tracks/haskell/exercises/binary-search-tree/package.yaml +1 -1
- data/tracks/haskell/exercises/binary/package.yaml +1 -1
- data/tracks/haskell/exercises/bob/package.yaml +1 -1
- data/tracks/haskell/exercises/bowling/package.yaml +1 -1
- data/tracks/haskell/exercises/bracket-push/package.yaml +1 -1
- data/tracks/haskell/exercises/change/package.yaml +1 -1
- data/tracks/haskell/exercises/clock/package.yaml +1 -1
- data/tracks/haskell/exercises/collatz-conjecture/package.yaml +1 -1
- data/tracks/haskell/exercises/complex-numbers/package.yaml +1 -1
- data/tracks/haskell/exercises/connect/package.yaml +1 -1
- data/tracks/haskell/exercises/crypto-square/package.yaml +1 -1
- data/tracks/haskell/exercises/custom-set/package.yaml +1 -1
- data/tracks/haskell/exercises/diamond/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/food-chain/package.yaml +1 -1
- data/tracks/haskell/exercises/forth/package.yaml +1 -1
- data/tracks/haskell/exercises/gigasecond/package.yaml +1 -1
- data/tracks/haskell/exercises/go-counting/package.yaml +1 -1
- data/tracks/haskell/exercises/grade-school/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/hexadecimal/package.yaml +1 -1
- data/tracks/haskell/exercises/house/package.yaml +1 -1
- data/tracks/haskell/exercises/isbn-verifier/package.yaml +1 -1
- data/tracks/haskell/exercises/isogram/package.yaml +1 -1
- data/tracks/haskell/exercises/kindergarten-garden/examples/success-standard/src/Garden.hs +1 -10
- data/tracks/haskell/exercises/kindergarten-garden/package.yaml +2 -3
- data/tracks/haskell/exercises/kindergarten-garden/src/Garden.hs +3 -7
- data/tracks/haskell/exercises/kindergarten-garden/test/Tests.hs +10 -16
- data/tracks/haskell/exercises/largest-series-product/package.yaml +1 -1
- data/tracks/haskell/exercises/leap/package.yaml +1 -1
- data/tracks/haskell/exercises/lens-person/examples/success-standard/package.yaml +0 -1
- data/tracks/haskell/exercises/lens-person/package.yaml +1 -1
- data/tracks/haskell/exercises/linked-list/package.yaml +1 -1
- data/tracks/haskell/exercises/list-ops/package.yaml +1 -1
- data/tracks/haskell/exercises/luhn/package.yaml +1 -1
- data/tracks/haskell/exercises/matrix/package.yaml +1 -1
- 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/octal/package.yaml +1 -1
- data/tracks/haskell/exercises/palindrome-products/package.yaml +1 -1
- data/tracks/haskell/exercises/pangram/package.yaml +1 -1
- data/tracks/haskell/exercises/parallel-letter-frequency/package.yaml +1 -1
- data/tracks/haskell/exercises/pascals-triangle/package.yaml +1 -1
- data/tracks/haskell/exercises/perfect-numbers/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/poker/package.yaml +1 -1
- data/tracks/haskell/exercises/pov/package.yaml +2 -2
- data/tracks/haskell/exercises/pov/test/Tests.hs +15 -0
- data/tracks/haskell/exercises/prime-factors/package.yaml +1 -1
- data/tracks/haskell/exercises/protein-translation/package.yaml +1 -1
- data/tracks/haskell/exercises/pythagorean-triplet/package.yaml +1 -1
- data/tracks/haskell/exercises/queen-attack/package.yaml +1 -1
- data/tracks/haskell/exercises/rail-fence-cipher/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-name/package.yaml +1 -1
- data/tracks/haskell/exercises/robot-simulator/package.yaml +1 -1
- data/tracks/haskell/exercises/roman-numerals/package.yaml +1 -1
- data/tracks/haskell/exercises/rotational-cipher/package.yaml +1 -1
- data/tracks/haskell/exercises/run-length-encoding/package.yaml +1 -1
- data/tracks/haskell/exercises/saddle-points/package.yaml +1 -1
- 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/series/package.yaml +1 -1
- data/tracks/haskell/exercises/sgf-parsing/package.yaml +1 -1
- data/tracks/haskell/exercises/sieve/package.yaml +1 -1
- data/tracks/haskell/exercises/simple-cipher/package.yaml +1 -1
- data/tracks/haskell/exercises/simple-linked-list/package.yaml +1 -1
- data/tracks/haskell/exercises/space-age/package.yaml +1 -1
- data/tracks/haskell/exercises/spiral-matrix/package.yaml +1 -1
- data/tracks/haskell/exercises/strain/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/transpose/package.yaml +1 -1
- data/tracks/haskell/exercises/triangle/package.yaml +1 -1
- data/tracks/haskell/exercises/trinary/package.yaml +1 -1
- data/tracks/haskell/exercises/twelve-days/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/haskell/exercises/zebra-puzzle/package.yaml +1 -1
- data/tracks/haskell/exercises/zipper/package.yaml +1 -1
- data/tracks/java/CONTRIBUTING.md +39 -3
- data/tracks/java/POLICIES.md +68 -3
- data/tracks/java/exercises/crypto-square/README.md +4 -5
- data/tracks/java/exercises/error-handling/README.md +38 -0
- data/tracks/java/exercises/series/README.md +6 -6
- data/tracks/java/exercises/sieve/README.md +5 -3
- data/tracks/java/scripts/canonical_data_check.sh +1 -1
- data/tracks/python/exercises/react/example.py +54 -63
- data/tracks/python/exercises/react/react.py +10 -10
- data/tracks/python/exercises/react/react_test.py +197 -131
- data/tracks/python/exercises/sieve/README.md +5 -3
- data/tracks/rust/exercises/react/example.rs +103 -64
- data/tracks/rust/exercises/react/src/lib.rs +31 -17
- data/tracks/rust/exercises/react/tests/react.rs +52 -61
- data/tracks/swift/config.json +11 -0
- data/tracks/swift/exercises/circular-buffer/Sources/CircularBufferExample.swift +12 -12
- data/tracks/swift/exercises/circular-buffer/Tests/CircularBufferTests/CircularBufferTests.swift +1 -1
- data/tracks/swift/exercises/proverb/Package.swift +5 -0
- data/tracks/swift/exercises/proverb/README.md +25 -0
- data/tracks/swift/exercises/proverb/Sources/Proverb.swift +1 -0
- data/tracks/swift/exercises/proverb/Sources/ProverbExample.swift +28 -0
- data/tracks/swift/exercises/proverb/Tests/LinuxMain.swift +6 -0
- data/tracks/swift/exercises/proverb/Tests/ProverbTests/ProverbTests.swift +61 -0
- data/tracks/typescript/config.json +14 -0
- data/tracks/typescript/exercises/palindrome-products/README.md +65 -0
- data/tracks/typescript/exercises/palindrome-products/package.json +36 -0
- data/tracks/typescript/exercises/palindrome-products/palindrome-products.example.ts +38 -0
- data/tracks/typescript/exercises/palindrome-products/palindrome-products.test.ts +69 -0
- data/tracks/typescript/exercises/palindrome-products/palindrome-products.ts +0 -0
- data/tracks/typescript/exercises/palindrome-products/tsconfig.json +22 -0
- data/tracks/typescript/exercises/palindrome-products/tslint.json +127 -0
- data/tracks/typescript/exercises/palindrome-products/yarn.lock +2624 -0
- metadata +17 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
module Garden (garden,
|
1
|
+
module Garden (garden, lookupPlants, Plant(..)) where
|
2
2
|
import qualified Data.Map as M
|
3
3
|
import Data.List (sort)
|
4
4
|
import Data.List.Split (chunksOf)
|
@@ -12,12 +12,6 @@ data Plant = Grass
|
|
12
12
|
type Student = String
|
13
13
|
type Garden = M.Map String [Plant]
|
14
14
|
|
15
|
-
defaultStudents :: [String]
|
16
|
-
defaultStudents =
|
17
|
-
[ "Alice", "Bob", "Charlie", "David", "Eve", "Fred"
|
18
|
-
, "Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"
|
19
|
-
]
|
20
|
-
|
21
15
|
fromChar :: Char -> Plant
|
22
16
|
fromChar c = case c of
|
23
17
|
'G' -> Grass
|
@@ -26,9 +20,6 @@ fromChar c = case c of
|
|
26
20
|
'V' -> Violets
|
27
21
|
_ -> error ("Unknown plant " ++ show c)
|
28
22
|
|
29
|
-
defaultGarden :: String -> Garden
|
30
|
-
defaultGarden = garden defaultStudents
|
31
|
-
|
32
23
|
garden :: [Student] -> String -> Garden
|
33
24
|
garden students plantString = M.fromListWith (++) pairs
|
34
25
|
where plantRows = map (map fromChar) (lines plantString)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
name: kindergarten-garden
|
2
|
-
version: 1.1.1.
|
2
|
+
version: 1.1.1.7
|
3
3
|
|
4
4
|
dependencies:
|
5
5
|
- base
|
@@ -7,10 +7,9 @@ dependencies:
|
|
7
7
|
library:
|
8
8
|
exposed-modules: Garden
|
9
9
|
source-dirs: src
|
10
|
-
dependencies:
|
10
|
+
# dependencies:
|
11
11
|
# - foo # List here the packages you
|
12
12
|
# - bar # want to use in your solution.
|
13
|
-
- containers
|
14
13
|
|
15
14
|
tests:
|
16
15
|
test:
|
@@ -1,23 +1,19 @@
|
|
1
1
|
module Garden
|
2
2
|
( Plant (..)
|
3
|
-
, defaultGarden
|
4
3
|
, garden
|
5
4
|
, lookupPlants
|
6
5
|
) where
|
7
6
|
|
8
|
-
import Data.Map (Map)
|
9
|
-
|
10
7
|
data Plant = Clover
|
11
8
|
| Grass
|
12
9
|
| Radishes
|
13
10
|
| Violets
|
14
11
|
deriving (Eq, Show)
|
15
12
|
|
16
|
-
|
17
|
-
defaultGarden plants = error "You need to implement this function."
|
13
|
+
data Garden = Dummy
|
18
14
|
|
19
|
-
garden :: [String] -> String ->
|
15
|
+
garden :: [String] -> String -> Garden
|
20
16
|
garden students plants = error "You need to implement this function."
|
21
17
|
|
22
|
-
lookupPlants :: String ->
|
18
|
+
lookupPlants :: String -> Garden -> [Plant]
|
23
19
|
lookupPlants student garden = error "You need to implement this function."
|
@@ -7,7 +7,6 @@ import Garden
|
|
7
7
|
, Radishes
|
8
8
|
, Violets
|
9
9
|
)
|
10
|
-
, defaultGarden
|
11
10
|
, garden
|
12
11
|
, lookupPlants
|
13
12
|
)
|
@@ -15,26 +14,32 @@ import Garden
|
|
15
14
|
main :: IO ()
|
16
15
|
main = hspecWith defaultConfig {configFastFail = True} specs
|
17
16
|
|
17
|
+
defaultStudents :: [String]
|
18
|
+
defaultStudents =
|
19
|
+
[ "Alice", "Bob", "Charlie", "David", "Eve", "Fred"
|
20
|
+
, "Ginny", "Harriet", "Ileana", "Joseph", "Kincaid", "Larry"
|
21
|
+
]
|
22
|
+
|
18
23
|
specs :: Spec
|
19
24
|
specs = do
|
20
25
|
|
21
26
|
it "garden with single student" $ do
|
22
27
|
|
23
|
-
let alicePlants = lookupPlants "Alice" .
|
28
|
+
let alicePlants = lookupPlants "Alice" . garden defaultStudents
|
24
29
|
|
25
30
|
alicePlants "RC\nGG" `shouldBe` [ Radishes, Clover, Grass , Grass ]
|
26
31
|
alicePlants "VC\nRC" `shouldBe` [ Violets , Clover, Radishes, Clover ]
|
27
32
|
|
28
33
|
it "garden with two students" $ do
|
29
34
|
|
30
|
-
let plants s = lookupPlants s $
|
35
|
+
let plants s = lookupPlants s $ garden defaultStudents plantList
|
31
36
|
plantList = "VVCG\nVVRC"
|
32
37
|
|
33
38
|
plants "Bob" `shouldBe` [ Clover, Grass, Radishes, Clover ]
|
34
39
|
|
35
40
|
it "garden with three students" $ do
|
36
41
|
|
37
|
-
let plants s = lookupPlants s $
|
42
|
+
let plants s = lookupPlants s $ garden defaultStudents plantList
|
38
43
|
plantList = "VVCCGG\nVVCCGG"
|
39
44
|
|
40
45
|
plants "Bob" `shouldBe` [ Clover, Clover, Clover, Clover ]
|
@@ -42,21 +47,10 @@ specs = do
|
|
42
47
|
|
43
48
|
it "full garden" $ do
|
44
49
|
|
45
|
-
let plants s = lookupPlants s $
|
50
|
+
let plants s = lookupPlants s $ garden defaultStudents plantList
|
46
51
|
plantList = "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"
|
47
52
|
|
48
53
|
plants "Alice" `shouldBe` [ Violets , Radishes, Violets , Radishes ]
|
49
54
|
plants "Bob" `shouldBe` [ Clover , Grass , Clover , Clover ]
|
50
55
|
plants "Kincaid" `shouldBe` [ Grass , Clover , Clover , Grass ]
|
51
56
|
plants "Larry" `shouldBe` [ Grass , Violets , Clover , Violets ]
|
52
|
-
|
53
|
-
it "non-alphabetical student list" $ do
|
54
|
-
|
55
|
-
let plants s = lookupPlants s $ garden students plantList
|
56
|
-
plantList = "VCRRGVRG\nRVGCCGCV"
|
57
|
-
students = ["Samantha", "Patricia", "Xander", "Roger"]
|
58
|
-
|
59
|
-
plants "Patricia" `shouldBe` [ Violets , Clover , Radishes, Violets ]
|
60
|
-
plants "Roger" `shouldBe` [ Radishes, Radishes, Grass , Clover ]
|
61
|
-
plants "Samantha" `shouldBe` [ Grass , Violets , Clover , Grass ]
|
62
|
-
plants "Xander" `shouldBe` [ Radishes, Grass , Clover , Violets ]
|