trackler 2.0.6.14 → 2.0.6.15
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/tracks/ceylon/.travis.yml +1 -0
- data/tracks/ceylon/bin/compile-all-stubs +16 -0
- data/tracks/ceylon/config.json +11 -0
- data/tracks/ceylon/exercises/react/example/Reactor.ceylon +96 -0
- data/tracks/ceylon/exercises/react/example/module.ceylon +4 -0
- data/tracks/ceylon/exercises/react/source/react/Reactor.ceylon +29 -0
- data/tracks/ceylon/exercises/react/source/react/ReactorTest.ceylon +195 -0
- data/tracks/ceylon/exercises/react/source/react/module.ceylon +3 -0
- data/tracks/csharp/config.json +9 -0
- data/tracks/csharp/exercises/pov/Example.cs +17 -17
- data/tracks/csharp/exercises/zipper/Example.cs +137 -0
- data/tracks/csharp/exercises/zipper/ZipperTest.cs +83 -0
- data/tracks/go/config.json +9 -0
- data/tracks/go/exercises/transpose/cases_test.go +247 -0
- data/tracks/go/exercises/transpose/example.go +25 -0
- data/tracks/go/exercises/transpose/example_gen.go +54 -0
- data/tracks/go/exercises/transpose/transpose_test.go +39 -0
- data/tracks/go/exercises/triangle/triangle.go +1 -1
- data/tracks/haskell/.travis.yml +2 -2
- data/tracks/haskell/common/stack.yaml +1 -1
- data/tracks/haskell/exercises/accumulate/stack.yaml +1 -1
- data/tracks/haskell/exercises/all-your-base/stack.yaml +1 -1
- data/tracks/haskell/exercises/allergies/stack.yaml +1 -1
- data/tracks/haskell/exercises/alphametics/stack.yaml +1 -1
- data/tracks/haskell/exercises/anagram/stack.yaml +1 -1
- data/tracks/haskell/exercises/atbash-cipher/stack.yaml +1 -1
- data/tracks/haskell/exercises/bank-account/stack.yaml +1 -1
- data/tracks/haskell/exercises/beer-song/stack.yaml +1 -1
- data/tracks/haskell/exercises/binary-search-tree/stack.yaml +1 -1
- data/tracks/haskell/exercises/binary/stack.yaml +1 -1
- data/tracks/haskell/exercises/bob/stack.yaml +1 -1
- data/tracks/haskell/exercises/bowling/stack.yaml +1 -1
- data/tracks/haskell/exercises/change/stack.yaml +1 -1
- data/tracks/haskell/exercises/clock/stack.yaml +1 -1
- data/tracks/haskell/exercises/connect/stack.yaml +1 -1
- data/tracks/haskell/exercises/crypto-square/stack.yaml +1 -1
- data/tracks/haskell/exercises/custom-set/stack.yaml +1 -1
- data/tracks/haskell/exercises/difference-of-squares/stack.yaml +1 -1
- data/tracks/haskell/exercises/dominoes/stack.yaml +1 -1
- data/tracks/haskell/exercises/etl/stack.yaml +1 -1
- data/tracks/haskell/exercises/food-chain/stack.yaml +1 -1
- data/tracks/haskell/exercises/forth/stack.yaml +1 -1
- data/tracks/haskell/exercises/gigasecond/stack.yaml +1 -1
- data/tracks/haskell/exercises/go-counting/stack.yaml +1 -1
- data/tracks/haskell/exercises/grade-school/stack.yaml +1 -1
- data/tracks/haskell/exercises/grains/stack.yaml +1 -1
- data/tracks/haskell/exercises/hamming/stack.yaml +1 -1
- data/tracks/haskell/exercises/hexadecimal/stack.yaml +1 -1
- data/tracks/haskell/exercises/house/stack.yaml +1 -1
- data/tracks/haskell/exercises/kindergarten-garden/stack.yaml +1 -1
- data/tracks/haskell/exercises/largest-series-product/stack.yaml +1 -1
- data/tracks/haskell/exercises/leap/stack.yaml +1 -1
- data/tracks/haskell/exercises/lens-person/stack.yaml +1 -1
- data/tracks/haskell/exercises/linked-list/stack.yaml +1 -1
- data/tracks/haskell/exercises/list-ops/stack.yaml +1 -1
- data/tracks/haskell/exercises/luhn/stack.yaml +1 -1
- data/tracks/haskell/exercises/matrix/stack.yaml +1 -1
- data/tracks/haskell/exercises/meetup/stack.yaml +1 -1
- data/tracks/haskell/exercises/minesweeper/stack.yaml +1 -1
- data/tracks/haskell/exercises/nth-prime/stack.yaml +1 -1
- data/tracks/haskell/exercises/nucleotide-count/stack.yaml +1 -1
- data/tracks/haskell/exercises/ocr-numbers/stack.yaml +1 -1
- data/tracks/haskell/exercises/octal/stack.yaml +1 -1
- data/tracks/haskell/exercises/palindrome-products/stack.yaml +1 -1
- data/tracks/haskell/exercises/parallel-letter-frequency/stack.yaml +1 -1
- data/tracks/haskell/exercises/pascals-triangle/stack.yaml +1 -1
- data/tracks/haskell/exercises/phone-number/stack.yaml +1 -1
- data/tracks/haskell/exercises/pig-latin/stack.yaml +1 -1
- data/tracks/haskell/exercises/pov/stack.yaml +1 -1
- data/tracks/haskell/exercises/prime-factors/stack.yaml +1 -1
- data/tracks/haskell/exercises/pythagorean-triplet/stack.yaml +1 -1
- data/tracks/haskell/exercises/queen-attack/stack.yaml +1 -1
- data/tracks/haskell/exercises/raindrops/stack.yaml +1 -1
- data/tracks/haskell/exercises/rna-transcription/stack.yaml +1 -1
- data/tracks/haskell/exercises/robot-name/stack.yaml +1 -1
- data/tracks/haskell/exercises/robot-simulator/stack.yaml +1 -1
- data/tracks/haskell/exercises/roman-numerals/stack.yaml +1 -1
- data/tracks/haskell/exercises/run-length-encoding/stack.yaml +1 -1
- data/tracks/haskell/exercises/saddle-points/stack.yaml +1 -1
- data/tracks/haskell/exercises/say/stack.yaml +1 -1
- data/tracks/haskell/exercises/scrabble-score/stack.yaml +1 -1
- data/tracks/haskell/exercises/secret-handshake/stack.yaml +1 -1
- data/tracks/haskell/exercises/series/stack.yaml +1 -1
- data/tracks/haskell/exercises/sgf-parsing/stack.yaml +1 -1
- data/tracks/haskell/exercises/sieve/stack.yaml +1 -1
- data/tracks/haskell/exercises/simple-cipher/stack.yaml +1 -1
- data/tracks/haskell/exercises/simple-linked-list/stack.yaml +1 -1
- data/tracks/haskell/exercises/space-age/stack.yaml +1 -1
- data/tracks/haskell/exercises/strain/stack.yaml +1 -1
- data/tracks/haskell/exercises/sublist/stack.yaml +1 -1
- data/tracks/haskell/exercises/sum-of-multiples/stack.yaml +1 -1
- data/tracks/haskell/exercises/triangle/stack.yaml +1 -1
- data/tracks/haskell/exercises/trinary/stack.yaml +1 -1
- data/tracks/haskell/exercises/word-count/stack.yaml +1 -1
- data/tracks/haskell/exercises/wordy/stack.yaml +1 -1
- data/tracks/haskell/exercises/zebra-puzzle/stack.yaml +1 -1
- data/tracks/haskell/exercises/zipper/stack.yaml +1 -1
- data/tracks/lua/exercises/list-ops/list-ops_spec.lua +1 -1
- data/tracks/objective-c/config.json +9 -0
- data/tracks/objective-c/exercises/beer-song/BeerSongExample.h +7 -0
- data/tracks/objective-c/exercises/beer-song/BeerSongExample.m +56 -0
- data/tracks/objective-c/exercises/beer-song/BeerSongTest.m +51 -0
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +23 -1
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/OCLint.xcscheme +1 -1
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/xobjectivecTest.xcscheme +1 -1
- data/tracks/perl6/config.json +5 -0
- data/tracks/perl6/exercises/grade-school/Example.pm +17 -0
- data/tracks/perl6/exercises/grade-school/grade-school.t +32 -0
- data/tracks/scala/config.json +6 -0
- data/tracks/scala/exercises/rna-transcription/build.sbt +2 -2
- data/tracks/scala/exercises/sublist/build.sbt +2 -2
- data/tracks/scala/exercises/sublist/src/test/scala/SublistTest.scala +1 -1
- metadata +19 -2
@@ -0,0 +1,25 @@
|
|
1
|
+
package transpose
|
2
|
+
|
3
|
+
func Transpose(m []string) []string {
|
4
|
+
max := maxLen(m)
|
5
|
+
t := make([]string, max)
|
6
|
+
for i, row := range m {
|
7
|
+
for j, c := range row {
|
8
|
+
t[j] += string(c)
|
9
|
+
}
|
10
|
+
remMax := maxLen(m[i:])
|
11
|
+
for j := len(row); j < remMax; j++ {
|
12
|
+
t[j] += " "
|
13
|
+
}
|
14
|
+
}
|
15
|
+
return t
|
16
|
+
}
|
17
|
+
|
18
|
+
func maxLen(m []string) (length int) {
|
19
|
+
for _, l := range m {
|
20
|
+
if len(l) > length {
|
21
|
+
length = len(l)
|
22
|
+
}
|
23
|
+
}
|
24
|
+
return
|
25
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
// +build ignore
|
2
|
+
|
3
|
+
package main
|
4
|
+
|
5
|
+
import (
|
6
|
+
"log"
|
7
|
+
"text/template"
|
8
|
+
|
9
|
+
"../../gen"
|
10
|
+
)
|
11
|
+
|
12
|
+
func main() {
|
13
|
+
t, err := template.New("").Parse(tmpl)
|
14
|
+
if err != nil {
|
15
|
+
log.Fatal(err)
|
16
|
+
}
|
17
|
+
var j js
|
18
|
+
if err := gen.Gen("transpose", &j, t); err != nil {
|
19
|
+
log.Fatal(err)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
// The JSON structure we expect to be able to unmarshal into
|
24
|
+
type js struct {
|
25
|
+
Cases []struct {
|
26
|
+
Description string
|
27
|
+
Input []string
|
28
|
+
Expected []string
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
// template applied to above data structure generates the Go test cases
|
33
|
+
var tmpl = `package transpose
|
34
|
+
|
35
|
+
// Source: {{.Ori}}
|
36
|
+
{{if .Commit}}// Commit: {{.Commit}}
|
37
|
+
{{end}}
|
38
|
+
|
39
|
+
var testCases = []struct {
|
40
|
+
description string
|
41
|
+
input []string
|
42
|
+
expected []string
|
43
|
+
}{
|
44
|
+
{{range .J.Cases}}{
|
45
|
+
{{printf "%q" .Description}},
|
46
|
+
[]string{
|
47
|
+
{{range .Input}} {{printf "%q" .}},
|
48
|
+
{{end}}},
|
49
|
+
[]string{
|
50
|
+
{{range .Expected}} {{printf "%q" .}},
|
51
|
+
{{end}}},
|
52
|
+
},
|
53
|
+
{{end}}}
|
54
|
+
`
|
@@ -0,0 +1,39 @@
|
|
1
|
+
package transpose
|
2
|
+
|
3
|
+
import (
|
4
|
+
"reflect"
|
5
|
+
"testing"
|
6
|
+
)
|
7
|
+
|
8
|
+
func TestTranspose(t *testing.T) {
|
9
|
+
for _, test := range testCases {
|
10
|
+
actual := Transpose(test.input)
|
11
|
+
if !reflect.DeepEqual(actual, test.expected) {
|
12
|
+
// let's make the error more specific and find the row it's on
|
13
|
+
min := min(len(test.expected), len(actual))
|
14
|
+
for i := 0; i < min; i++ {
|
15
|
+
if test.expected[i] != actual[i] {
|
16
|
+
t.Fatalf("\n\tTranspose(%q): %s\n\n\tExpected: %q\n\tGot: %q\n\n\tRow %d Expected: %q Got: %q",
|
17
|
+
test.input, test.description, test.expected, actual, i, test.expected[i], actual[i])
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
// helper function
|
25
|
+
// https://stackoverflow.com/questions/27516387/what-is-the-correct-way-to-find-the-min-between-two-integers-in-go
|
26
|
+
func min(a, b int) int {
|
27
|
+
if a < b {
|
28
|
+
return a
|
29
|
+
}
|
30
|
+
return b
|
31
|
+
}
|
32
|
+
|
33
|
+
func BenchmarkTranspose(b *testing.B) {
|
34
|
+
for _, test := range testCases {
|
35
|
+
for i := 0; i < b.N; i++ {
|
36
|
+
Transpose(test.input)
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
data/tracks/haskell/.travis.yml
CHANGED
@@ -11,8 +11,8 @@ cache:
|
|
11
11
|
- $HOME/.foldercache # Per exercise `.stack-work` cache.
|
12
12
|
|
13
13
|
env:
|
14
|
-
- RESOLVER="lts-7.
|
15
|
-
- RESOLVER="nightly"
|
14
|
+
- RESOLVER="lts-7.16" CURRENT="YES" # Equal to each stack.yaml.
|
15
|
+
- RESOLVER="nightly" # Latest nightly snapshot.
|
16
16
|
|
17
17
|
matrix:
|
18
18
|
allow_failures: # The snapshot `nightly` is just an alias to
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|
@@ -1 +1 @@
|
|
1
|
-
resolver: lts-7.
|
1
|
+
resolver: lts-7.16
|