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.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/clojure/config.json +1 -0
  4. data/tracks/clojure/docs/ABOUT.md +13 -0
  5. data/tracks/clojure/docs/INSTALLATION.md +21 -0
  6. data/tracks/clojure/docs/LEARNING.md +29 -0
  7. data/tracks/clojure/docs/RESOURCES.md +9 -0
  8. data/tracks/clojure/docs/{TESTS.org → TESTS.md} +22 -27
  9. data/tracks/clojure/exercises/anagram/src/anagram.clj +1 -1
  10. data/tracks/clojure/exercises/armstrong-numbers/src/armstrong_numbers.clj +1 -1
  11. data/tracks/clojure/exercises/beer-song/src/beer_song.clj +1 -1
  12. data/tracks/clojure/exercises/bob/src/bob.clj +1 -1
  13. data/tracks/clojure/exercises/clock/src/clock.clj +3 -3
  14. data/tracks/clojure/exercises/collatz-conjecture/src/collatz_conjecture.clj +1 -1
  15. data/tracks/clojure/exercises/etl/src/etl.clj +1 -1
  16. data/tracks/clojure/exercises/flatten-array/src/flatten_array.clj +1 -1
  17. data/tracks/clojure/exercises/grade-school/src/grade_school.clj +3 -3
  18. data/tracks/clojure/exercises/hamming/src/hamming.clj +2 -2
  19. data/tracks/clojure/exercises/leap/src/leap.clj +1 -1
  20. data/tracks/clojure/exercises/nucleotide-count/src/nucleotide_count.clj +2 -2
  21. data/tracks/clojure/exercises/phone-number/src/phone_number.clj +3 -3
  22. data/tracks/clojure/exercises/reverse-string/src/reverse_string.clj +1 -1
  23. data/tracks/clojure/exercises/rna-transcription/src/rna_transcription.clj +1 -1
  24. data/tracks/clojure/exercises/robot-name/src/robot_name.clj +2 -2
  25. data/tracks/clojure/exercises/run-length-encoding/src/run_length_encoding.clj +3 -3
  26. data/tracks/clojure/exercises/say/src/say.clj +1 -1
  27. data/tracks/clojure/exercises/series/src/series.clj +1 -1
  28. data/tracks/clojure/exercises/sublist/src/sublist.clj +1 -1
  29. data/tracks/clojure/exercises/two-fer/src/two_fer.clj +1 -1
  30. data/tracks/clojure/exercises/word-count/src/word_count.clj +1 -1
  31. data/tracks/ecmascript/config.json +12 -0
  32. data/tracks/ecmascript/exercises/reverse-string/README.md +42 -0
  33. data/tracks/ecmascript/exercises/reverse-string/example.js +9 -0
  34. data/tracks/ecmascript/exercises/reverse-string/package.json +70 -0
  35. data/tracks/ecmascript/exercises/reverse-string/reverse-string.spec.js +33 -0
  36. data/tracks/erlang/config.json +11 -0
  37. data/tracks/erlang/exercises/armstrong-numbers/README.md +53 -0
  38. data/tracks/erlang/exercises/armstrong-numbers/rebar.config +30 -0
  39. data/tracks/erlang/exercises/armstrong-numbers/src/armstrong_numbers.app.src +9 -0
  40. data/tracks/erlang/exercises/armstrong-numbers/src/armstrong_numbers.erl +8 -0
  41. data/tracks/erlang/exercises/armstrong-numbers/src/example.erl +29 -0
  42. data/tracks/erlang/exercises/armstrong-numbers/test/armstrong_numbers_tests.erl +33 -0
  43. data/tracks/erlang/exercises/bracket-push/src/example.erl +1 -1
  44. data/tracks/erlang/exercises/isbn-verifier/src/example.erl +1 -1
  45. data/tracks/julia/config.json +12 -0
  46. data/tracks/julia/docs/ABOUT.md +3 -3
  47. data/tracks/julia/exercises/spiral-matrix/README.md +31 -0
  48. data/tracks/julia/exercises/spiral-matrix/example.jl +9 -0
  49. data/tracks/julia/exercises/spiral-matrix/runtests.jl +25 -0
  50. data/tracks/julia/exercises/spiral-matrix/spiral-matrix.jl +3 -0
  51. data/tracks/perl5/config.json +1 -0
  52. data/tracks/perl5/docs/ABOUT.md +4 -3
  53. data/tracks/perl6/config.json +1 -0
  54. data/tracks/powershell/config.json +1 -1
  55. data/tracks/python/exercises/hello-world/example.py +2 -5
  56. data/tracks/python/exercises/hello-world/hello_world.py +1 -1
  57. data/tracks/reasonml/.gitignore +1 -0
  58. data/tracks/reasonml/Makefile +6 -3
  59. data/tracks/reasonml/config.json +21 -0
  60. data/tracks/reasonml/exercises/anagram/src/Anagram.rei +1 -0
  61. data/tracks/reasonml/exercises/anagram/src/Example.re +10 -12
  62. data/tracks/reasonml/exercises/binary-search/src/BinarySearch.rei +1 -0
  63. data/tracks/reasonml/exercises/bob/src/Bob.rei +1 -0
  64. data/tracks/reasonml/exercises/change/src/Change.rei +2 -0
  65. data/tracks/reasonml/exercises/change/src/Example.re +16 -15
  66. data/tracks/reasonml/exercises/hello-world/src/HelloWorld.rei +1 -0
  67. data/tracks/reasonml/exercises/leap/src/Leap.rei +1 -0
  68. data/tracks/reasonml/exercises/pangram/README.md +21 -0
  69. data/tracks/reasonml/exercises/pangram/__tests__/Pangram_test.re +36 -0
  70. data/tracks/reasonml/exercises/pangram/bsconfig.json +30 -0
  71. data/tracks/reasonml/exercises/pangram/package.json +20 -0
  72. data/tracks/reasonml/exercises/pangram/src/Example.re +36 -0
  73. data/tracks/reasonml/exercises/pangram/src/Pangram.rei +1 -0
  74. data/tracks/reasonml/exercises/phone-number/.gitignore +6 -0
  75. data/tracks/reasonml/exercises/phone-number/README.md +43 -0
  76. data/tracks/reasonml/exercises/phone-number/__tests__/PhoneNumber_test.re +48 -0
  77. data/tracks/reasonml/exercises/phone-number/bsconfig.json +27 -0
  78. data/tracks/reasonml/exercises/phone-number/package-lock.json +5853 -0
  79. data/tracks/reasonml/exercises/phone-number/package.json +20 -0
  80. data/tracks/reasonml/exercises/phone-number/src/Example.re +13 -0
  81. data/tracks/reasonml/exercises/phone-number/src/PhoneNumber.rei +1 -0
  82. data/tracks/reasonml/exercises/raindrops/src/Raindrops.rei +1 -0
  83. data/tracks/reasonml/exercises/rna-transcription/src/Example.re +13 -6
  84. data/tracks/reasonml/exercises/rna-transcription/src/RnaTranscription.rei +13 -0
  85. data/tracks/reasonml/exercises/run-length-encoding/src/RunLengthEncoding.rei +2 -0
  86. data/tracks/reasonml/exercises/space-age/__tests__/SpaceAge_test.re +8 -8
  87. data/tracks/reasonml/exercises/space-age/src/Example.re +3 -5
  88. data/tracks/reasonml/exercises/space-age/src/SpaceAge.rei +11 -0
  89. data/tracks/reasonml/exercises/word-count/src/WordCount.rei +1 -0
  90. data/tracks/sml/config.json +1 -0
  91. data/tracks/swift/.gitignore +5 -3
  92. data/tracks/swift/.travis.yml +8 -1
  93. data/tracks/swift/Package.swift +70 -11
  94. data/tracks/swift/exercises/atbash-cipher/Package.swift +1 -1
  95. data/tracks/swift/exercises/atbash-cipher/Sources/{Atbash.swift → AtbashCipher.swift} +0 -0
  96. data/tracks/swift/exercises/atbash-cipher/Sources/{AtbashExample.swift → AtbashCipherExample.swift} +1 -1
  97. data/tracks/swift/exercises/atbash-cipher/Tests/{AtbashTests/AtbashTests.swift → AtbashCipherTests/AtbashCipherTests.swift} +11 -11
  98. data/tracks/swift/exercises/atbash-cipher/Tests/LinuxMain.swift +2 -2
  99. data/tracks/swift/exercises/custom-set/Sources/CustomSetExample.swift +6 -2
  100. data/tracks/swift/exercises/poker/Sources/PokerExample.swift +2 -2
  101. metadata +49 -14
  102. data/tracks/clojure/docs/ABOUT.org +0 -24
  103. data/tracks/clojure/docs/INSTALLATION.org +0 -26
  104. data/tracks/clojure/docs/LEARNING.org +0 -35
  105. data/tracks/clojure/docs/RESOURCES.org +0 -9
  106. data/tracks/swift/.swift-version +0 -1
  107. data/tracks/swift/allProjects.xcworkspace.source/contents.xcworkspacedata +0 -4
  108. data/tracks/swift/allProjects.xcworkspace.source/xcshareddata/xcschemes/AllTest.xcscheme +0 -46
  109. 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 = A | C | G | T;
1
+ type dna =
2
+ | A
3
+ | C
4
+ | G
5
+ | T;
2
6
 
3
- type rna = A | C | G | U;
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);
@@ -0,0 +1,13 @@
1
+ type dna =
2
+ | A
3
+ | C
4
+ | G
5
+ | T;
6
+
7
+ type rna =
8
+ | A
9
+ | C
10
+ | G
11
+ | U;
12
+
13
+ let toRna: list(dna) => list(rna);
@@ -0,0 +1,2 @@
1
+ let encode: string => string;
2
+ let decode: string => string;
@@ -3,35 +3,35 @@ open Expect;
3
3
 
4
4
  describe("Space Age", () => {
5
5
  test("age on Earth", () =>
6
- expect(SpaceAge.age_on(Earth, 1000000000.0))
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.age_on(Mercury, 2134835688.0))
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.age_on(Venus, 189839836.0))
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.age_on(Mars, 2329871239.0))
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.age_on(Jupiter, 901876382.0))
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.age_on(Saturn, 3000000000.0))
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.age_on(Uranus, 3210123456.0))
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.age_on(Neptune, 8210123456.0))
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 earth_years = (seconds) => seconds /. 31557600.0;
11
+ let earthYears = seconds => seconds /. 31557600.0;
12
12
 
13
- let rel_years =
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 age_on = (planet, seconds) => {
25
- earth_years(seconds) /. rel_years(planet)
26
- };
24
+ let ageOn = (planet, seconds) => earthYears(seconds) /. relYears(planet);
@@ -0,0 +1,11 @@
1
+ type planet =
2
+ | Mercury
3
+ | Venus
4
+ | Earth
5
+ | Mars
6
+ | Jupiter
7
+ | Saturn
8
+ | Neptune
9
+ | Uranus;
10
+
11
+ let ageOn: (planet, float) => float;
@@ -0,0 +1 @@
1
+ let wordCount: string => array((string, int));
@@ -9,6 +9,7 @@
9
9
  "slug": "hello-world",
10
10
  "uuid": "a00f98a6-98dd-4c8a-b3d1-adc1d56eef29",
11
11
  "core": true,
12
+ "auto_approve": true,
12
13
  "unlocked_by": null,
13
14
  "difficulty": 1,
14
15
  "topics": []
@@ -24,6 +24,8 @@ DerivedData
24
24
  #Idea IDE
25
25
  .idea
26
26
 
27
- # All Projects
28
- allProjects
29
- allProjects.xcworkspace
27
+ # Swift
28
+ .build
29
+ LinuxMain.swift
30
+ Package.resolved
31
+ xswift.xcodeproj/
@@ -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
 
@@ -1,26 +1,85 @@
1
+ // swift-tools-version:4.2
2
+
1
3
  import PackageDescription
2
4
  import Foundation
3
5
 
4
- let path = FileManager.default.currentDirectoryPath + "/config.json"
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: path), options: Data.ReadingOptions.mappedIfSafe) ,
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
- let deprecated = jsonDict["deprecated"] as? [String] {
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 \(path)")
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 dependencies = allProblems.map { Package.Dependency.Package(url: "./exercises/\($0)/", majorVersion: 1) }
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
- dependencies: dependencies
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
+ )
@@ -1,5 +1,5 @@
1
1
  import PackageDescription
2
2
 
3
3
  let package = Package(
4
- name: "Atbash"
4
+ name: "AtbashCipher"
5
5
  )
@@ -1,6 +1,6 @@
1
1
  import Foundation
2
2
 
3
- struct Atbash {
3
+ struct AtbashCipher {
4
4
 
5
5
  private static func stripWhiteSpaceAndPunctuations(_ input: String) -> String {
6
6
  var returnString = ""
@@ -1,44 +1,44 @@
1
1
  import XCTest
2
- @testable import Atbash
2
+ @testable import AtbashCipher
3
3
 
4
- class AtbashTests: XCTestCase {
4
+ class AtbashCipherTests: XCTestCase {
5
5
 
6
6
  func testEncodeNo() {
7
- XCTAssertEqual("ml", Atbash.encode("no") )
7
+ XCTAssertEqual("ml", AtbashCipher.encode("no") )
8
8
  }
9
9
 
10
10
  func testEncodeYes() {
11
- XCTAssertEqual("bvh", Atbash.encode("yes") )
11
+ XCTAssertEqual("bvh", AtbashCipher.encode("yes") )
12
12
  }
13
13
 
14
14
  func testEncodeOMG() {
15
- XCTAssertEqual("lnt", Atbash.encode("OMG") )
15
+ XCTAssertEqual("lnt", AtbashCipher.encode("OMG") )
16
16
  }
17
17
 
18
18
  func testEncodeOMGWithSpaces() {
19
- XCTAssertEqual("lnt", Atbash.encode("O M G") )
19
+ XCTAssertEqual("lnt", AtbashCipher.encode("O M G") )
20
20
  }
21
21
 
22
22
  func testEncodeLongWord() {
23
- XCTAssertEqual("nrmwy oldrm tob", Atbash.encode("mindblowingly") )
23
+ XCTAssertEqual("nrmwy oldrm tob", AtbashCipher.encode("mindblowingly") )
24
24
  }
25
25
 
26
26
  func testEncodeNumbers() {
27
27
  XCTAssertEqual("gvhgr mt123 gvhgr mt",
28
- Atbash.encode("Testing, 1 2 3, testing.") )
28
+ AtbashCipher.encode("Testing, 1 2 3, testing.") )
29
29
  }
30
30
 
31
31
  func testEncodeSentence() {
32
- XCTAssertEqual("gifgs rhurx grlm", Atbash.encode("Truth is fiction.") )
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, Atbash.encode(plaintext) )
38
+ XCTAssertEqual(cipher, AtbashCipher.encode(plaintext) )
39
39
  }
40
40
 
41
- static var allTests: [(String, (AtbashTests) -> () throws -> Void)] {
41
+ static var allTests: [(String, (AtbashCipherTests) -> () throws -> Void)] {
42
42
  return [
43
43
  ("testEncodeNo", testEncodeNo),
44
44
  ("testEncodeYes", testEncodeYes),
@@ -1,6 +1,6 @@
1
1
  import XCTest
2
- @testable import AtbashTests
2
+ @testable import AtbashCipherTests
3
3
 
4
4
  XCTMain([
5
- testCase(AtbashTests.allTests),
5
+ testCase(AtbashCipherTests.allTests),
6
6
  ])
@@ -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 result = toReturn.map({ key, value in return (rank:key, count:value) }).sorted(by: { (one, two) in
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.175
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-24 00:00:00.000000000 Z
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.org
1578
- - tracks/clojure/docs/INSTALLATION.org
1579
- - tracks/clojure/docs/LEARNING.org
1580
- - tracks/clojure/docs/RESOURCES.org
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.org
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/Atbash.swift
14603
- - tracks/swift/exercises/atbash-cipher/Sources/AtbashExample.swift
14604
- - tracks/swift/exercises/atbash-cipher/Tests/AtbashTests/AtbashTests.swift
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