trackler 2.2.1.175 → 2.2.1.176
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/clojure/config.json +1 -0
- data/tracks/clojure/docs/ABOUT.md +13 -0
- data/tracks/clojure/docs/INSTALLATION.md +21 -0
- data/tracks/clojure/docs/LEARNING.md +29 -0
- data/tracks/clojure/docs/RESOURCES.md +9 -0
- data/tracks/clojure/docs/{TESTS.org → TESTS.md} +22 -27
- data/tracks/clojure/exercises/anagram/src/anagram.clj +1 -1
- data/tracks/clojure/exercises/armstrong-numbers/src/armstrong_numbers.clj +1 -1
- data/tracks/clojure/exercises/beer-song/src/beer_song.clj +1 -1
- data/tracks/clojure/exercises/bob/src/bob.clj +1 -1
- data/tracks/clojure/exercises/clock/src/clock.clj +3 -3
- data/tracks/clojure/exercises/collatz-conjecture/src/collatz_conjecture.clj +1 -1
- data/tracks/clojure/exercises/etl/src/etl.clj +1 -1
- data/tracks/clojure/exercises/flatten-array/src/flatten_array.clj +1 -1
- data/tracks/clojure/exercises/grade-school/src/grade_school.clj +3 -3
- data/tracks/clojure/exercises/hamming/src/hamming.clj +2 -2
- data/tracks/clojure/exercises/leap/src/leap.clj +1 -1
- data/tracks/clojure/exercises/nucleotide-count/src/nucleotide_count.clj +2 -2
- data/tracks/clojure/exercises/phone-number/src/phone_number.clj +3 -3
- data/tracks/clojure/exercises/reverse-string/src/reverse_string.clj +1 -1
- data/tracks/clojure/exercises/rna-transcription/src/rna_transcription.clj +1 -1
- data/tracks/clojure/exercises/robot-name/src/robot_name.clj +2 -2
- data/tracks/clojure/exercises/run-length-encoding/src/run_length_encoding.clj +3 -3
- data/tracks/clojure/exercises/say/src/say.clj +1 -1
- data/tracks/clojure/exercises/series/src/series.clj +1 -1
- data/tracks/clojure/exercises/sublist/src/sublist.clj +1 -1
- data/tracks/clojure/exercises/two-fer/src/two_fer.clj +1 -1
- data/tracks/clojure/exercises/word-count/src/word_count.clj +1 -1
- data/tracks/ecmascript/config.json +12 -0
- data/tracks/ecmascript/exercises/reverse-string/README.md +42 -0
- data/tracks/ecmascript/exercises/reverse-string/example.js +9 -0
- data/tracks/ecmascript/exercises/reverse-string/package.json +70 -0
- data/tracks/ecmascript/exercises/reverse-string/reverse-string.spec.js +33 -0
- data/tracks/erlang/config.json +11 -0
- data/tracks/erlang/exercises/armstrong-numbers/README.md +53 -0
- data/tracks/erlang/exercises/armstrong-numbers/rebar.config +30 -0
- data/tracks/erlang/exercises/armstrong-numbers/src/armstrong_numbers.app.src +9 -0
- data/tracks/erlang/exercises/armstrong-numbers/src/armstrong_numbers.erl +8 -0
- data/tracks/erlang/exercises/armstrong-numbers/src/example.erl +29 -0
- data/tracks/erlang/exercises/armstrong-numbers/test/armstrong_numbers_tests.erl +33 -0
- data/tracks/erlang/exercises/bracket-push/src/example.erl +1 -1
- data/tracks/erlang/exercises/isbn-verifier/src/example.erl +1 -1
- data/tracks/julia/config.json +12 -0
- data/tracks/julia/docs/ABOUT.md +3 -3
- data/tracks/julia/exercises/spiral-matrix/README.md +31 -0
- data/tracks/julia/exercises/spiral-matrix/example.jl +9 -0
- data/tracks/julia/exercises/spiral-matrix/runtests.jl +25 -0
- data/tracks/julia/exercises/spiral-matrix/spiral-matrix.jl +3 -0
- data/tracks/perl5/config.json +1 -0
- data/tracks/perl5/docs/ABOUT.md +4 -3
- data/tracks/perl6/config.json +1 -0
- data/tracks/powershell/config.json +1 -1
- data/tracks/python/exercises/hello-world/example.py +2 -5
- data/tracks/python/exercises/hello-world/hello_world.py +1 -1
- data/tracks/reasonml/.gitignore +1 -0
- data/tracks/reasonml/Makefile +6 -3
- data/tracks/reasonml/config.json +21 -0
- data/tracks/reasonml/exercises/anagram/src/Anagram.rei +1 -0
- data/tracks/reasonml/exercises/anagram/src/Example.re +10 -12
- data/tracks/reasonml/exercises/binary-search/src/BinarySearch.rei +1 -0
- data/tracks/reasonml/exercises/bob/src/Bob.rei +1 -0
- data/tracks/reasonml/exercises/change/src/Change.rei +2 -0
- data/tracks/reasonml/exercises/change/src/Example.re +16 -15
- data/tracks/reasonml/exercises/hello-world/src/HelloWorld.rei +1 -0
- data/tracks/reasonml/exercises/leap/src/Leap.rei +1 -0
- data/tracks/reasonml/exercises/pangram/README.md +21 -0
- data/tracks/reasonml/exercises/pangram/__tests__/Pangram_test.re +36 -0
- data/tracks/reasonml/exercises/pangram/bsconfig.json +30 -0
- data/tracks/reasonml/exercises/pangram/package.json +20 -0
- data/tracks/reasonml/exercises/pangram/src/Example.re +36 -0
- data/tracks/reasonml/exercises/pangram/src/Pangram.rei +1 -0
- data/tracks/reasonml/exercises/phone-number/.gitignore +6 -0
- data/tracks/reasonml/exercises/phone-number/README.md +43 -0
- data/tracks/reasonml/exercises/phone-number/__tests__/PhoneNumber_test.re +48 -0
- data/tracks/reasonml/exercises/phone-number/bsconfig.json +27 -0
- data/tracks/reasonml/exercises/phone-number/package-lock.json +5853 -0
- data/tracks/reasonml/exercises/phone-number/package.json +20 -0
- data/tracks/reasonml/exercises/phone-number/src/Example.re +13 -0
- data/tracks/reasonml/exercises/phone-number/src/PhoneNumber.rei +1 -0
- data/tracks/reasonml/exercises/raindrops/src/Raindrops.rei +1 -0
- data/tracks/reasonml/exercises/rna-transcription/src/Example.re +13 -6
- data/tracks/reasonml/exercises/rna-transcription/src/RnaTranscription.rei +13 -0
- data/tracks/reasonml/exercises/run-length-encoding/src/RunLengthEncoding.rei +2 -0
- data/tracks/reasonml/exercises/space-age/__tests__/SpaceAge_test.re +8 -8
- data/tracks/reasonml/exercises/space-age/src/Example.re +3 -5
- data/tracks/reasonml/exercises/space-age/src/SpaceAge.rei +11 -0
- data/tracks/reasonml/exercises/word-count/src/WordCount.rei +1 -0
- data/tracks/sml/config.json +1 -0
- data/tracks/swift/.gitignore +5 -3
- data/tracks/swift/.travis.yml +8 -1
- data/tracks/swift/Package.swift +70 -11
- data/tracks/swift/exercises/atbash-cipher/Package.swift +1 -1
- data/tracks/swift/exercises/atbash-cipher/Sources/{Atbash.swift → AtbashCipher.swift} +0 -0
- data/tracks/swift/exercises/atbash-cipher/Sources/{AtbashExample.swift → AtbashCipherExample.swift} +1 -1
- data/tracks/swift/exercises/atbash-cipher/Tests/{AtbashTests/AtbashTests.swift → AtbashCipherTests/AtbashCipherTests.swift} +11 -11
- data/tracks/swift/exercises/atbash-cipher/Tests/LinuxMain.swift +2 -2
- data/tracks/swift/exercises/custom-set/Sources/CustomSetExample.swift +6 -2
- data/tracks/swift/exercises/poker/Sources/PokerExample.swift +2 -2
- metadata +49 -14
- data/tracks/clojure/docs/ABOUT.org +0 -24
- data/tracks/clojure/docs/INSTALLATION.org +0 -26
- data/tracks/clojure/docs/LEARNING.org +0 -35
- data/tracks/clojure/docs/RESOURCES.org +0 -9
- data/tracks/swift/.swift-version +0 -1
- data/tracks/swift/allProjects.xcworkspace.source/contents.xcworkspacedata +0 -4
- data/tracks/swift/allProjects.xcworkspace.source/xcshareddata/xcschemes/AllTest.xcscheme +0 -46
- data/tracks/swift/allProjectsPopulateWorkspace.sh +0 -35
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"name": "phone-number",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"scripts": {
|
5
|
+
"build": "bsb -make-world",
|
6
|
+
"start": "bsb -make-world -w",
|
7
|
+
"clean": "bsb -clean-world",
|
8
|
+
"test": "jest --watchAll",
|
9
|
+
"test:ci": "jest --ci --bail --no-cache"
|
10
|
+
},
|
11
|
+
"keywords": [
|
12
|
+
"BuckleScript"
|
13
|
+
],
|
14
|
+
"author": "",
|
15
|
+
"license": "MIT",
|
16
|
+
"devDependencies": {
|
17
|
+
"@glennsl/bs-jest": "^0.4.2",
|
18
|
+
"bs-platform": "^3.1.5"
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
let phoneNumber = (input: string) : option(string) => {
|
2
|
+
let cleanNoDigits = (input: string) : string =>
|
3
|
+
input |> Js.String.replaceByRe([%re "/\\D/g"], "");
|
4
|
+
|
5
|
+
let checkFormat = (phone: string) : option(string) => {
|
6
|
+
let re = [%re "/^1?[2-9]\\d{2}[2-9]\\d{2}\\d{4}$/"];
|
7
|
+
|
8
|
+
Js.Re.test(phone, re) ?
|
9
|
+
Some(Js.String.sliceToEnd(~from=-10, phone)) : None;
|
10
|
+
};
|
11
|
+
|
12
|
+
input |> cleanNoDigits |> checkFormat;
|
13
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
let phoneNumber: string => option(string);
|
@@ -0,0 +1 @@
|
|
1
|
+
let raindrops: int => string;
|
@@ -1,14 +1,21 @@
|
|
1
|
-
type dna =
|
1
|
+
type dna =
|
2
|
+
| A
|
3
|
+
| C
|
4
|
+
| G
|
5
|
+
| T;
|
2
6
|
|
3
|
-
type rna =
|
7
|
+
type rna =
|
8
|
+
| A
|
9
|
+
| C
|
10
|
+
| G
|
11
|
+
| U;
|
4
12
|
|
5
|
-
let convertOne = (d: dna) =>
|
6
|
-
switch(d) {
|
13
|
+
let convertOne = (d: dna) =>
|
14
|
+
switch (d) {
|
7
15
|
| A => U
|
8
16
|
| C => G
|
9
17
|
| G => C
|
10
18
|
| T => A
|
11
19
|
};
|
12
20
|
|
13
|
-
let toRna = (ds: list(dna)) =>
|
14
|
-
List.map(convertOne, ds);
|
21
|
+
let toRna = (ds: list(dna)) => List.map(convertOne, ds);
|
@@ -3,35 +3,35 @@ open Expect;
|
|
3
3
|
|
4
4
|
describe("Space Age", () => {
|
5
5
|
test("age on Earth", () =>
|
6
|
-
expect(SpaceAge.
|
6
|
+
expect(SpaceAge.ageOn(Earth, 1000000000.0))
|
7
7
|
|> toBeSoCloseTo(31.69, ~digits=2)
|
8
8
|
);
|
9
9
|
test("age on Mercury", () =>
|
10
|
-
expect(SpaceAge.
|
10
|
+
expect(SpaceAge.ageOn(Mercury, 2134835688.0))
|
11
11
|
|> toBeSoCloseTo(280.88, ~digits=2)
|
12
12
|
);
|
13
13
|
test("age on Venus", () =>
|
14
|
-
expect(SpaceAge.
|
14
|
+
expect(SpaceAge.ageOn(Venus, 189839836.0))
|
15
15
|
|> toBeSoCloseTo(9.78, ~digits=2)
|
16
16
|
);
|
17
17
|
test("age on Mars", () =>
|
18
|
-
expect(SpaceAge.
|
18
|
+
expect(SpaceAge.ageOn(Mars, 2329871239.0))
|
19
19
|
|> toBeSoCloseTo(39.25, ~digits=2)
|
20
20
|
);
|
21
21
|
test("age on Jupiter", () =>
|
22
|
-
expect(SpaceAge.
|
22
|
+
expect(SpaceAge.ageOn(Jupiter, 901876382.0))
|
23
23
|
|> toBeSoCloseTo(2.41, ~digits=2)
|
24
24
|
);
|
25
25
|
test("age on Saturn", () =>
|
26
|
-
expect(SpaceAge.
|
26
|
+
expect(SpaceAge.ageOn(Saturn, 3000000000.0))
|
27
27
|
|> toBeSoCloseTo(3.23, ~digits=2)
|
28
28
|
);
|
29
29
|
test("age on Uranus", () =>
|
30
|
-
expect(SpaceAge.
|
30
|
+
expect(SpaceAge.ageOn(Uranus, 3210123456.0))
|
31
31
|
|> toBeSoCloseTo(1.21, ~digits=2)
|
32
32
|
);
|
33
33
|
test("age on Neptune", () =>
|
34
|
-
expect(SpaceAge.
|
34
|
+
expect(SpaceAge.ageOn(Neptune, 8210123456.0))
|
35
35
|
|> toBeSoCloseTo(1.58, ~digits=2)
|
36
36
|
);
|
37
37
|
});
|
@@ -8,9 +8,9 @@ type planet =
|
|
8
8
|
| Neptune
|
9
9
|
| Uranus;
|
10
10
|
|
11
|
-
let
|
11
|
+
let earthYears = seconds => seconds /. 31557600.0;
|
12
12
|
|
13
|
-
let
|
13
|
+
let relYears =
|
14
14
|
fun
|
15
15
|
| Mercury => 0.2408467
|
16
16
|
| Venus => 0.61519726
|
@@ -21,6 +21,4 @@ let rel_years =
|
|
21
21
|
| Uranus => 84.016846
|
22
22
|
| Neptune => 164.79132;
|
23
23
|
|
24
|
-
let
|
25
|
-
earth_years(seconds) /. rel_years(planet)
|
26
|
-
};
|
24
|
+
let ageOn = (planet, seconds) => earthYears(seconds) /. relYears(planet);
|
@@ -0,0 +1 @@
|
|
1
|
+
let wordCount: string => array((string, int));
|
data/tracks/sml/config.json
CHANGED
data/tracks/swift/.gitignore
CHANGED
data/tracks/swift/.travis.yml
CHANGED
@@ -16,5 +16,12 @@ matrix:
|
|
16
16
|
env: JOB=Linux41x
|
17
17
|
sudo: required
|
18
18
|
services: docker
|
19
|
-
|
19
|
+
- script:
|
20
|
+
- bin/fetch-configlet
|
21
|
+
- bin/configlet lint .
|
22
|
+
- docker run -v `pwd`:/swift norionomura/swift:swift-4.2-branch bash -c "cd /swift && swift test --verbose"
|
23
|
+
- cat LinuxMain.swift
|
24
|
+
env: JOB=Linux42x
|
25
|
+
sudo: required
|
26
|
+
services: docker
|
20
27
|
|
data/tracks/swift/Package.swift
CHANGED
@@ -1,26 +1,85 @@
|
|
1
|
+
// swift-tools-version:4.2
|
2
|
+
|
1
3
|
import PackageDescription
|
2
4
|
import Foundation
|
3
5
|
|
4
|
-
|
6
|
+
extension String {
|
7
|
+
var PascalCased: String {
|
8
|
+
let items = self.components(separatedBy: "-")
|
9
|
+
return items.reduce("", { $0 + $1.capitalized })
|
10
|
+
}
|
11
|
+
}
|
12
|
+
let currentDirectory = FileManager.default.currentDirectoryPath
|
13
|
+
let configPath = currentDirectory + "/config.json"
|
5
14
|
var allProblems = [String]()
|
6
15
|
|
7
16
|
if
|
8
|
-
let jsonData = try? Data(contentsOf: URL(fileURLWithPath:
|
9
|
-
let json = try? JSONSerialization.jsonObject(with: jsonData, options: [])
|
17
|
+
let jsonData = try? Data(contentsOf: URL(fileURLWithPath: configPath), options: Data.ReadingOptions.mappedIfSafe),
|
18
|
+
let json = try? JSONSerialization.jsonObject(with: jsonData, options: []),
|
10
19
|
let jsonDict = json as? [String: Any],
|
11
20
|
let exercisesDict = jsonDict["exercises"] as? [[String: Any]],
|
12
|
-
let exercises = exercisesDict.map({ $0["slug"] }) as? [String]
|
13
|
-
|
14
|
-
|
21
|
+
let exercises = exercisesDict.map({ $0["slug"] }) as? [String]
|
22
|
+
{
|
15
23
|
allProblems += exercises
|
16
|
-
allProblems += deprecated
|
17
24
|
} else {
|
18
|
-
print("Could not parse config.json at \(
|
25
|
+
print("Could not parse config.json at \(configPath)")
|
19
26
|
}
|
27
|
+
let allProblemsPascalCase = allProblems.map{ $0.PascalCased}
|
28
|
+
|
29
|
+
#if os(Linux)
|
30
|
+
// Create ./Tests/LinuxMain.swift
|
31
|
+
let allTestCases = allProblemsPascalCase.map{ "testCase(\($0)Tests.allTests),"}
|
32
|
+
|
33
|
+
let linuxMainText =
|
34
|
+
"""
|
35
|
+
import XCTest
|
36
|
+
@testable import xswiftTests
|
37
|
+
|
38
|
+
XCTMain([
|
39
|
+
\(allTestCases.joined(separator: "\n"))
|
40
|
+
])
|
41
|
+
"""
|
42
|
+
|
43
|
+
let linuxMainFilePath = currentDirectory + "/LinuxMain.swift"
|
44
|
+
|
45
|
+
do {
|
46
|
+
if FileManager.default.fileExists(atPath:linuxMainFilePath) {
|
47
|
+
try FileManager.default.removeItem(atPath: linuxMainFilePath)
|
48
|
+
}
|
49
|
+
try linuxMainText.write(to: URL(fileURLWithPath: linuxMainFilePath), atomically: false, encoding: .utf8)
|
50
|
+
}
|
51
|
+
catch let fileError {
|
52
|
+
print("Could not write file. \(fileError)")
|
53
|
+
}
|
54
|
+
#endif
|
55
|
+
|
56
|
+
let packageDependencies:[Package.Dependency] = allProblems.map { .package(path: "./exercises/\($0)/") }
|
57
|
+
let targetDependencies:[Target.Dependency] = allProblemsPascalCase.map { .byNameItem(name:"\($0)") }
|
20
58
|
|
21
|
-
let
|
59
|
+
let sources = allProblems.map { "./\($0)/Sources" }
|
60
|
+
let testSources = allProblems.map { "./\($0)/Tests" }
|
22
61
|
|
23
62
|
let package = Package(
|
24
63
|
name: "xswift",
|
25
|
-
|
26
|
-
|
64
|
+
products: [
|
65
|
+
.library(
|
66
|
+
name: "xswift",
|
67
|
+
targets: ["xswift"]
|
68
|
+
)
|
69
|
+
],
|
70
|
+
dependencies: packageDependencies,
|
71
|
+
targets: [
|
72
|
+
.target(
|
73
|
+
name: "xswift",
|
74
|
+
dependencies: targetDependencies,
|
75
|
+
path: "./exercises",
|
76
|
+
sources: sources
|
77
|
+
),
|
78
|
+
.testTarget(
|
79
|
+
name: "xswiftTests",
|
80
|
+
dependencies: ["xswift"],
|
81
|
+
path: "./exercises",
|
82
|
+
sources: testSources
|
83
|
+
),
|
84
|
+
]
|
85
|
+
)
|
File without changes
|
@@ -1,44 +1,44 @@
|
|
1
1
|
import XCTest
|
2
|
-
@testable import
|
2
|
+
@testable import AtbashCipher
|
3
3
|
|
4
|
-
class
|
4
|
+
class AtbashCipherTests: XCTestCase {
|
5
5
|
|
6
6
|
func testEncodeNo() {
|
7
|
-
XCTAssertEqual("ml",
|
7
|
+
XCTAssertEqual("ml", AtbashCipher.encode("no") )
|
8
8
|
}
|
9
9
|
|
10
10
|
func testEncodeYes() {
|
11
|
-
XCTAssertEqual("bvh",
|
11
|
+
XCTAssertEqual("bvh", AtbashCipher.encode("yes") )
|
12
12
|
}
|
13
13
|
|
14
14
|
func testEncodeOMG() {
|
15
|
-
XCTAssertEqual("lnt",
|
15
|
+
XCTAssertEqual("lnt", AtbashCipher.encode("OMG") )
|
16
16
|
}
|
17
17
|
|
18
18
|
func testEncodeOMGWithSpaces() {
|
19
|
-
XCTAssertEqual("lnt",
|
19
|
+
XCTAssertEqual("lnt", AtbashCipher.encode("O M G") )
|
20
20
|
}
|
21
21
|
|
22
22
|
func testEncodeLongWord() {
|
23
|
-
XCTAssertEqual("nrmwy oldrm tob",
|
23
|
+
XCTAssertEqual("nrmwy oldrm tob", AtbashCipher.encode("mindblowingly") )
|
24
24
|
}
|
25
25
|
|
26
26
|
func testEncodeNumbers() {
|
27
27
|
XCTAssertEqual("gvhgr mt123 gvhgr mt",
|
28
|
-
|
28
|
+
AtbashCipher.encode("Testing, 1 2 3, testing.") )
|
29
29
|
}
|
30
30
|
|
31
31
|
func testEncodeSentence() {
|
32
|
-
XCTAssertEqual("gifgs rhurx grlm",
|
32
|
+
XCTAssertEqual("gifgs rhurx grlm", AtbashCipher.encode("Truth is fiction.") )
|
33
33
|
}
|
34
34
|
|
35
35
|
func testEncodeAllTheThings() {
|
36
36
|
let plaintext = "The quick brown fox jumps over the lazy dog."
|
37
37
|
let cipher = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
|
38
|
-
XCTAssertEqual(cipher,
|
38
|
+
XCTAssertEqual(cipher, AtbashCipher.encode(plaintext) )
|
39
39
|
}
|
40
40
|
|
41
|
-
static var allTests: [(String, (
|
41
|
+
static var allTests: [(String, (AtbashCipherTests) -> () throws -> Void)] {
|
42
42
|
return [
|
43
43
|
("testEncodeNo", testEncodeNo),
|
44
44
|
("testEncodeYes", testEncodeYes),
|
@@ -2,6 +2,12 @@ func == <T> (lh: CustomSet<T>, rh: CustomSet<T>) -> Bool {
|
|
2
2
|
return lh.contents.keys.sorted { $0.hashValue < $1.hashValue } == rh.contents.keys.sorted { $0.hashValue < $1.hashValue }
|
3
3
|
|
4
4
|
}
|
5
|
+
|
6
|
+
extension CustomSet where T:Comparable {
|
7
|
+
|
8
|
+
var toSortedArray: [Element] { return Array(contents.keys.sorted { $0 < $1 }) }
|
9
|
+
}
|
10
|
+
|
5
11
|
struct CustomSet<T: Hashable>: Equatable {
|
6
12
|
|
7
13
|
typealias Element = T
|
@@ -10,8 +16,6 @@ struct CustomSet<T: Hashable>: Equatable {
|
|
10
16
|
|
11
17
|
var size: Int { return contents.count }
|
12
18
|
|
13
|
-
var toSortedArray: [Element] { return Array(contents.keys.sorted { $0.hashValue < $1.hashValue }) }
|
14
|
-
|
15
19
|
init<S: Sequence>(_ sequence: S) where S.Iterator.Element == Element {
|
16
20
|
self.contents = [:]
|
17
21
|
_ = sequence.map { self.contents[$0] = true }
|
@@ -68,10 +68,10 @@ enum HandRank {
|
|
68
68
|
toReturn[each] = (toReturn[each] ?? 0) + 1
|
69
69
|
}
|
70
70
|
}
|
71
|
-
let
|
71
|
+
let preresult = toReturn.map({ key, value in return (rank:key, count:value) })
|
72
|
+
return preresult.sorted(by: { (one, two) in
|
72
73
|
return one.count == two.count ? one.rank > two.rank : one.count > two.count
|
73
74
|
})
|
74
|
-
return result
|
75
75
|
}
|
76
76
|
|
77
77
|
static func isFlush(_ inputHand: PokerHand) -> (bool: Bool, suit: Suit) {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.1.
|
4
|
+
version: 2.2.1.176
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -1574,12 +1574,12 @@ files:
|
|
1574
1574
|
- tracks/clojure/config.json
|
1575
1575
|
- tracks/clojure/config/exercise_readme.go.tmpl
|
1576
1576
|
- tracks/clojure/config/maintainers.json
|
1577
|
-
- tracks/clojure/docs/ABOUT.
|
1578
|
-
- tracks/clojure/docs/INSTALLATION.
|
1579
|
-
- tracks/clojure/docs/LEARNING.
|
1580
|
-
- tracks/clojure/docs/RESOURCES.
|
1577
|
+
- tracks/clojure/docs/ABOUT.md
|
1578
|
+
- tracks/clojure/docs/INSTALLATION.md
|
1579
|
+
- tracks/clojure/docs/LEARNING.md
|
1580
|
+
- tracks/clojure/docs/RESOURCES.md
|
1581
1581
|
- tracks/clojure/docs/SNIPPET.txt
|
1582
|
-
- tracks/clojure/docs/TESTS.
|
1582
|
+
- tracks/clojure/docs/TESTS.md
|
1583
1583
|
- tracks/clojure/exercises/accumulate/README.md
|
1584
1584
|
- tracks/clojure/exercises/accumulate/project.clj
|
1585
1585
|
- tracks/clojure/exercises/accumulate/src/accumulate.clj
|
@@ -4029,6 +4029,10 @@ files:
|
|
4029
4029
|
- tracks/ecmascript/exercises/rectangles/example.js
|
4030
4030
|
- tracks/ecmascript/exercises/rectangles/package.json
|
4031
4031
|
- tracks/ecmascript/exercises/rectangles/rectangles.spec.js
|
4032
|
+
- tracks/ecmascript/exercises/reverse-string/README.md
|
4033
|
+
- tracks/ecmascript/exercises/reverse-string/example.js
|
4034
|
+
- tracks/ecmascript/exercises/reverse-string/package.json
|
4035
|
+
- tracks/ecmascript/exercises/reverse-string/reverse-string.spec.js
|
4032
4036
|
- tracks/ecmascript/exercises/rna-transcription/README.md
|
4033
4037
|
- tracks/ecmascript/exercises/rna-transcription/example.js
|
4034
4038
|
- tracks/ecmascript/exercises/rna-transcription/package.json
|
@@ -4983,6 +4987,12 @@ files:
|
|
4983
4987
|
- tracks/erlang/exercises/anagram/src/anagram.erl
|
4984
4988
|
- tracks/erlang/exercises/anagram/src/example.erl
|
4985
4989
|
- tracks/erlang/exercises/anagram/test/anagram_tests.erl
|
4990
|
+
- tracks/erlang/exercises/armstrong-numbers/README.md
|
4991
|
+
- tracks/erlang/exercises/armstrong-numbers/rebar.config
|
4992
|
+
- tracks/erlang/exercises/armstrong-numbers/src/armstrong_numbers.app.src
|
4993
|
+
- tracks/erlang/exercises/armstrong-numbers/src/armstrong_numbers.erl
|
4994
|
+
- tracks/erlang/exercises/armstrong-numbers/src/example.erl
|
4995
|
+
- tracks/erlang/exercises/armstrong-numbers/test/armstrong_numbers_tests.erl
|
4986
4996
|
- tracks/erlang/exercises/atbash-cipher/README.md
|
4987
4997
|
- tracks/erlang/exercises/atbash-cipher/rebar.config
|
4988
4998
|
- tracks/erlang/exercises/atbash-cipher/src/atbash_cipher.app.src
|
@@ -8828,6 +8838,10 @@ files:
|
|
8828
8838
|
- tracks/julia/exercises/sieve/example.jl
|
8829
8839
|
- tracks/julia/exercises/sieve/runtests.jl
|
8830
8840
|
- tracks/julia/exercises/sieve/sieve.jl
|
8841
|
+
- tracks/julia/exercises/spiral-matrix/README.md
|
8842
|
+
- tracks/julia/exercises/spiral-matrix/example.jl
|
8843
|
+
- tracks/julia/exercises/spiral-matrix/runtests.jl
|
8844
|
+
- tracks/julia/exercises/spiral-matrix/spiral-matrix.jl
|
8831
8845
|
- tracks/julia/exercises/transpose/README.md
|
8832
8846
|
- tracks/julia/exercises/transpose/example.jl
|
8833
8847
|
- tracks/julia/exercises/transpose/runtests.jl
|
@@ -12612,22 +12626,26 @@ files:
|
|
12612
12626
|
- tracks/reasonml/exercises/anagram/__tests__/Anagram_test.re
|
12613
12627
|
- tracks/reasonml/exercises/anagram/bsconfig.json
|
12614
12628
|
- tracks/reasonml/exercises/anagram/package.json
|
12629
|
+
- tracks/reasonml/exercises/anagram/src/Anagram.rei
|
12615
12630
|
- tracks/reasonml/exercises/anagram/src/Example.re
|
12616
12631
|
- tracks/reasonml/exercises/binary-search/README.md
|
12617
12632
|
- tracks/reasonml/exercises/binary-search/__tests__/BinarySearch_test.re
|
12618
12633
|
- tracks/reasonml/exercises/binary-search/bsconfig.json
|
12619
12634
|
- tracks/reasonml/exercises/binary-search/package.json
|
12635
|
+
- tracks/reasonml/exercises/binary-search/src/BinarySearch.rei
|
12620
12636
|
- tracks/reasonml/exercises/binary-search/src/Example.re
|
12621
12637
|
- tracks/reasonml/exercises/bob/README.md
|
12622
12638
|
- tracks/reasonml/exercises/bob/__tests__/Bob_test.re
|
12623
12639
|
- tracks/reasonml/exercises/bob/bsconfig.json
|
12624
12640
|
- tracks/reasonml/exercises/bob/package-lock.json
|
12625
12641
|
- tracks/reasonml/exercises/bob/package.json
|
12642
|
+
- tracks/reasonml/exercises/bob/src/Bob.rei
|
12626
12643
|
- tracks/reasonml/exercises/bob/src/Example.re
|
12627
12644
|
- tracks/reasonml/exercises/change/README.md
|
12628
12645
|
- tracks/reasonml/exercises/change/__tests__/Change_test.re
|
12629
12646
|
- tracks/reasonml/exercises/change/bsconfig.json
|
12630
12647
|
- tracks/reasonml/exercises/change/package.json
|
12648
|
+
- tracks/reasonml/exercises/change/src/Change.rei
|
12631
12649
|
- tracks/reasonml/exercises/change/src/Example.re
|
12632
12650
|
- tracks/reasonml/exercises/hello-world/README.md
|
12633
12651
|
- tracks/reasonml/exercises/hello-world/__tests__/HelloWorld_test.re
|
@@ -12635,38 +12653,59 @@ files:
|
|
12635
12653
|
- tracks/reasonml/exercises/hello-world/package-lock.json
|
12636
12654
|
- tracks/reasonml/exercises/hello-world/package.json
|
12637
12655
|
- tracks/reasonml/exercises/hello-world/src/Example.re
|
12656
|
+
- tracks/reasonml/exercises/hello-world/src/HelloWorld.rei
|
12638
12657
|
- tracks/reasonml/exercises/leap/README.md
|
12639
12658
|
- tracks/reasonml/exercises/leap/__tests__/Leap_test.re
|
12640
12659
|
- tracks/reasonml/exercises/leap/bsconfig.json
|
12641
12660
|
- tracks/reasonml/exercises/leap/package.json
|
12642
12661
|
- tracks/reasonml/exercises/leap/src/Example.re
|
12662
|
+
- tracks/reasonml/exercises/leap/src/Leap.rei
|
12663
|
+
- tracks/reasonml/exercises/pangram/README.md
|
12664
|
+
- tracks/reasonml/exercises/pangram/__tests__/Pangram_test.re
|
12665
|
+
- tracks/reasonml/exercises/pangram/bsconfig.json
|
12666
|
+
- tracks/reasonml/exercises/pangram/package.json
|
12667
|
+
- tracks/reasonml/exercises/pangram/src/Example.re
|
12668
|
+
- tracks/reasonml/exercises/pangram/src/Pangram.rei
|
12669
|
+
- tracks/reasonml/exercises/phone-number/.gitignore
|
12670
|
+
- tracks/reasonml/exercises/phone-number/README.md
|
12671
|
+
- tracks/reasonml/exercises/phone-number/__tests__/PhoneNumber_test.re
|
12672
|
+
- tracks/reasonml/exercises/phone-number/bsconfig.json
|
12673
|
+
- tracks/reasonml/exercises/phone-number/package-lock.json
|
12674
|
+
- tracks/reasonml/exercises/phone-number/package.json
|
12675
|
+
- tracks/reasonml/exercises/phone-number/src/Example.re
|
12676
|
+
- tracks/reasonml/exercises/phone-number/src/PhoneNumber.rei
|
12643
12677
|
- tracks/reasonml/exercises/raindrops/README.md
|
12644
12678
|
- tracks/reasonml/exercises/raindrops/__tests__/Raindrops_test.re
|
12645
12679
|
- tracks/reasonml/exercises/raindrops/bsconfig.json
|
12646
12680
|
- tracks/reasonml/exercises/raindrops/package-lock.json
|
12647
12681
|
- tracks/reasonml/exercises/raindrops/package.json
|
12648
12682
|
- tracks/reasonml/exercises/raindrops/src/Example.re
|
12683
|
+
- tracks/reasonml/exercises/raindrops/src/Raindrops.rei
|
12649
12684
|
- tracks/reasonml/exercises/rna-transcription/README.md
|
12650
12685
|
- tracks/reasonml/exercises/rna-transcription/__tests__/RnaTranscription_test.re
|
12651
12686
|
- tracks/reasonml/exercises/rna-transcription/bsconfig.json
|
12652
12687
|
- tracks/reasonml/exercises/rna-transcription/package.json
|
12653
12688
|
- tracks/reasonml/exercises/rna-transcription/src/Example.re
|
12689
|
+
- tracks/reasonml/exercises/rna-transcription/src/RnaTranscription.rei
|
12654
12690
|
- tracks/reasonml/exercises/run-length-encoding/README.md
|
12655
12691
|
- tracks/reasonml/exercises/run-length-encoding/__tests__/RunLengthEncoding_test.re
|
12656
12692
|
- tracks/reasonml/exercises/run-length-encoding/bsconfig.json
|
12657
12693
|
- tracks/reasonml/exercises/run-length-encoding/package.json
|
12658
12694
|
- tracks/reasonml/exercises/run-length-encoding/src/Example.re
|
12695
|
+
- tracks/reasonml/exercises/run-length-encoding/src/RunLengthEncoding.rei
|
12659
12696
|
- tracks/reasonml/exercises/space-age/README.md
|
12660
12697
|
- tracks/reasonml/exercises/space-age/__tests__/SpaceAge_test.re
|
12661
12698
|
- tracks/reasonml/exercises/space-age/bsconfig.json
|
12662
12699
|
- tracks/reasonml/exercises/space-age/package.json
|
12663
12700
|
- tracks/reasonml/exercises/space-age/src/Example.re
|
12701
|
+
- tracks/reasonml/exercises/space-age/src/SpaceAge.rei
|
12664
12702
|
- tracks/reasonml/exercises/word-count/README.md
|
12665
12703
|
- tracks/reasonml/exercises/word-count/__tests__/WordCount_test.re
|
12666
12704
|
- tracks/reasonml/exercises/word-count/bsconfig.json
|
12667
12705
|
- tracks/reasonml/exercises/word-count/package-lock.json
|
12668
12706
|
- tracks/reasonml/exercises/word-count/package.json
|
12669
12707
|
- tracks/reasonml/exercises/word-count/src/Example.re
|
12708
|
+
- tracks/reasonml/exercises/word-count/src/WordCount.rei
|
12670
12709
|
- tracks/reasonml/img/.keep
|
12671
12710
|
- tracks/reasonml/package-lock.json
|
12672
12711
|
- tracks/reasonml/package.json
|
@@ -14536,16 +14575,12 @@ files:
|
|
14536
14575
|
- tracks/sml/lib/testlib.sml
|
14537
14576
|
- tracks/swift/.git
|
14538
14577
|
- tracks/swift/.gitignore
|
14539
|
-
- tracks/swift/.swift-version
|
14540
14578
|
- tracks/swift/.swiftlint.yml
|
14541
14579
|
- tracks/swift/.travis.yml
|
14542
14580
|
- tracks/swift/Dangerfile
|
14543
14581
|
- tracks/swift/LICENSE
|
14544
14582
|
- tracks/swift/Package.swift
|
14545
14583
|
- tracks/swift/README.md
|
14546
|
-
- tracks/swift/allProjects.xcworkspace.source/contents.xcworkspacedata
|
14547
|
-
- tracks/swift/allProjects.xcworkspace.source/xcshareddata/xcschemes/AllTest.xcscheme
|
14548
|
-
- tracks/swift/allProjectsPopulateWorkspace.sh
|
14549
14584
|
- tracks/swift/bin/fetch-configlet
|
14550
14585
|
- tracks/swift/circle.yml
|
14551
14586
|
- tracks/swift/config.json
|
@@ -14599,9 +14634,9 @@ files:
|
|
14599
14634
|
- tracks/swift/exercises/atbash-cipher/.gitignore
|
14600
14635
|
- tracks/swift/exercises/atbash-cipher/Package.swift
|
14601
14636
|
- tracks/swift/exercises/atbash-cipher/README.md
|
14602
|
-
- tracks/swift/exercises/atbash-cipher/Sources/
|
14603
|
-
- tracks/swift/exercises/atbash-cipher/Sources/
|
14604
|
-
- tracks/swift/exercises/atbash-cipher/Tests/
|
14637
|
+
- tracks/swift/exercises/atbash-cipher/Sources/AtbashCipher.swift
|
14638
|
+
- tracks/swift/exercises/atbash-cipher/Sources/AtbashCipherExample.swift
|
14639
|
+
- tracks/swift/exercises/atbash-cipher/Tests/AtbashCipherTests/AtbashCipherTests.swift
|
14605
14640
|
- tracks/swift/exercises/atbash-cipher/Tests/LinuxMain.swift
|
14606
14641
|
- tracks/swift/exercises/beer-song/.gitignore
|
14607
14642
|
- tracks/swift/exercises/beer-song/Package.swift
|