trackler 2.2.1.129 → 2.2.1.130

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/scale-generator/description.md +9 -16
  4. data/tracks/dart/config.json +9 -9
  5. data/tracks/dart/exercises/raindrops/lib/raindrops.dart +1 -1
  6. data/tracks/dart/exercises/raindrops/test/raindrops_test.dart +59 -44
  7. data/tracks/dart/exercises/rna-transcription/test/rna_transcription_test.dart +37 -44
  8. data/tracks/fsharp/exercises/go-counting/Example.fs +24 -20
  9. data/tracks/fsharp/exercises/go-counting/GoCountingTest.fs +110 -51
  10. data/tracks/fsharp/generators/Generators.fs +84 -0
  11. data/tracks/java/config.json +13 -13
  12. data/tracks/purescript/config.json +12 -0
  13. data/tracks/purescript/exercises/phone-number/README.md +36 -0
  14. data/tracks/purescript/exercises/phone-number/bower.json +26 -0
  15. data/tracks/purescript/exercises/phone-number/examples/src/PhoneNumber.purs +30 -0
  16. data/tracks/purescript/exercises/phone-number/src/PhoneNumber.purs +6 -0
  17. data/tracks/purescript/exercises/phone-number/test/Main.purs +50 -0
  18. data/tracks/rust/_test/check-stubs.sh +29 -0
  19. data/tracks/rust/_test/ensure-stubs-compile.sh +24 -5
  20. data/tracks/rust/exercises/all-your-base/src/lib.rs +1 -2
  21. data/tracks/rust/exercises/armstrong-numbers/src/lib.rs +2 -2
  22. data/tracks/rust/exercises/beer-song/src/lib.rs +2 -2
  23. data/tracks/rust/exercises/bob/src/lib.rs +1 -1
  24. data/tracks/rust/exercises/circular-buffer/tests/circular-buffer.rs +96 -101
  25. data/tracks/rust/exercises/collatz-conjecture/src/lib.rs +4 -2
  26. data/tracks/rust/exercises/decimal/.meta/description.md +1 -1
  27. data/tracks/rust/exercises/decimal/README.md +1 -1
  28. data/tracks/rust/exercises/difference-of-squares/src/lib.rs +6 -3
  29. data/tracks/rust/exercises/forth/src/lib.rs +1 -1
  30. data/tracks/rust/exercises/grade-school/src/lib.rs +2 -4
  31. data/tracks/rust/exercises/grains/src/lib.rs +1 -1
  32. data/tracks/rust/exercises/leap/src/lib.rs +1 -1
  33. data/tracks/rust/exercises/macros/.meta/description.md +1 -1
  34. data/tracks/rust/exercises/macros/README.md +1 -1
  35. data/tracks/rust/exercises/ocr-numbers/src/lib.rs +1 -2
  36. data/tracks/rust/exercises/parallel-letter-frequency/.meta/hints.md +1 -1
  37. data/tracks/rust/exercises/parallel-letter-frequency/README.md +1 -1
  38. data/tracks/rust/exercises/pascals-triangle/src/lib.rs +1 -1
  39. data/tracks/rust/exercises/perfect-numbers/src/lib.rs +1 -1
  40. data/tracks/rust/exercises/prime-factors/src/lib.rs +1 -1
  41. data/tracks/rust/exercises/proverb/src/lib.rs +1 -1
  42. data/tracks/rust/exercises/raindrops/src/lib.rs +1 -1
  43. data/tracks/rust/exercises/react/src/lib.rs +11 -9
  44. data/tracks/rust/exercises/robot-simulator/src/lib.rs +6 -4
  45. data/tracks/rust/exercises/saddle-points/src/lib.rs +1 -1
  46. data/tracks/rust/exercises/simple-linked-list/src/lib.rs +5 -5
  47. data/tracks/rust/exercises/space-age/src/lib.rs +6 -3
  48. data/tracks/rust/exercises/sum-of-multiples/src/lib.rs +1 -1
  49. data/tracks/rust/exercises/two-bucket/src/lib.rs +7 -1
  50. data/tracks/rust/exercises/variable-length-quantity/src/lib.rs +2 -2
  51. data/tracks/typescript/exercises/list-ops/list-ops.example.ts +9 -13
  52. data/tracks/typescript/exercises/list-ops/list-ops.test.ts +9 -17
  53. metadata +8 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb29fe65c3ecd5e8a634ddabb722ee8bf9853f3e
4
- data.tar.gz: 3fe12ee29a4011a03cf539696880996e05b38148
3
+ metadata.gz: 923eff384744b6182eb32fb442de07be36209106
4
+ data.tar.gz: '02753792b8af2f08857952bb33d769096c5f8bd0'
5
5
  SHA512:
6
- metadata.gz: 741a5f089384c1fdfde42dd6d158d43ff503b306cca392668ebddb3eb05db9a4d0ef16ad78379594dbf7dc8be5a8316c7d4977e2c461ed0d3900bed1707520d3
7
- data.tar.gz: cb32027c2fbe7646481eb4a19ea399b05183dd3b9d8f1ca1bbbe21c1f7ee5d42d2d0b8a5cc8b4c41d5479bc993bc0202b7d6f56504349314fe7717bc3e19f78c
6
+ metadata.gz: 418bfe90ffbb922d431bb20b9dd0df31c74bf29ec568e7d84474f91aba5e9ff405b5bd3ffaf9592e0f70506a14a93c0ebe058fdc38fa4a7f65e1f67b04ac64e5
7
+ data.tar.gz: 8abdcc2a182bca4ec7a7aaf54a40049a02a2ba1d07354580d980172fb416771fcf559cdf3f9a5da1ede3ffe6b33c78e5467e1c0609ebe4b237dd8f98096ea98a
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.129"
2
+ VERSION = "2.2.1.130"
3
3
  end
@@ -2,13 +2,13 @@ Given a tonic, or starting note, and a set of intervals, generate
2
2
  the musical scale starting with the tonic and following the
3
3
  specified interval pattern.
4
4
 
5
- Scales in Western music are based on the chromatic (12-note) scale.This
5
+ Scales in Western music are based on the chromatic (12-note) scale. This
6
6
  scale can be expressed as the following group of pitches:
7
7
 
8
8
  A, A#, B, C, C#, D, D#, E, F, F#, G, G#
9
9
 
10
- A given sharp note (indicated by a #), can also be expressed as the flat
11
- of the note above it (indicated by a b), so the chromatic scale can also be
10
+ A given sharp note (indicated by a #) can also be expressed as the flat
11
+ of the note above it (indicated by a b) so the chromatic scale can also be
12
12
  written like this:
13
13
 
14
14
  A, Bb, B, C, Db, D, Eb, E, F, Gb, G, Ab
@@ -18,9 +18,9 @@ collection. They have seven pitches, and are called diatonic scales.
18
18
  The collection of notes in these scales is written with either sharps or
19
19
  flats, depending on the tonic. Here is a list of which are which:
20
20
 
21
- No Accidentals:
21
+ No Sharps or Flats:
22
22
  C major
23
- A minor
23
+ a minor
24
24
 
25
25
  Use Sharps:
26
26
  G, D, A, E, B, F# major
@@ -41,14 +41,7 @@ a "whole step" or "major second" (written as an upper-case "M"). The
41
41
  diatonic scales are built using only these two intervals between
42
42
  adjacent notes.
43
43
 
44
- Non-diatonic scales can contain the same letter twice, and can contain other intervals.
45
- Sometimes they may be smaller than usual (diminished, written "D"), or larger
46
- (augmented, written "A"). Intervals larger than an augmented second have other names.
47
-
48
- Here is a table of pitches with the names of their interval distance from the tonic (A).
49
-
50
- | A | A# | B | C | C# | D | D# | E | F | F# | G | G# | A |
51
- |:------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:------:|
52
- | Unison | Min 2nd | Maj 2nd | Min 3rd | Maj 3rd | Per 4th | Tritone | Per 5th | Min 6th | Maj 6th | Min 7th | Maj 7th | Octave |
53
- | | | Dim 3rd | Aug 2nd | Dim 4th | | Aug 4th | Dim 5th | Aug 5th | Dim 7th | Aug 6th | Dim 8ve | |
54
- | | | | | | | Dim 5th | | | | | | |
44
+ Non-diatonic scales can contain other intervals. An "augmented first"
45
+ interval, written "A", has two interceding notes (e.g., from A to C or
46
+ Db to E). There are also smaller and larger intervals, but they will not
47
+ figure into this exercise.
@@ -23,7 +23,7 @@
23
23
  "integers",
24
24
  "logic"
25
25
  ],
26
- "unlocked_by": "hello-world",
26
+ "unlocked_by": null,
27
27
  "uuid": "4bcfd789-dee6-4dd9-8524-076508504eda"
28
28
  },
29
29
  {
@@ -34,7 +34,7 @@
34
34
  "integers",
35
35
  "mathematics"
36
36
  ],
37
- "unlocked_by": "leap",
37
+ "unlocked_by": null,
38
38
  "uuid": "c1cdab6f-c18c-4173-828a-2191151d20d4"
39
39
  },
40
40
  {
@@ -47,7 +47,7 @@
47
47
  "maps",
48
48
  "regular_expressions"
49
49
  ],
50
- "unlocked_by": "difference-of-squares",
50
+ "unlocked_by": null,
51
51
  "uuid": "b74dde02-03d0-4165-8302-e8ba119b486b"
52
52
  },
53
53
  {
@@ -62,7 +62,7 @@
62
62
  "strings",
63
63
  "unicode"
64
64
  ],
65
- "unlocked_by": "word-count",
65
+ "unlocked_by": null,
66
66
  "uuid": "615a83cc-a905-435a-a30e-f052b61cfd4c"
67
67
  },
68
68
  {
@@ -75,7 +75,7 @@
75
75
  "equality",
76
76
  "strings"
77
77
  ],
78
- "unlocked_by": "bob",
78
+ "unlocked_by": null,
79
79
  "uuid": "91c8033d-f40c-4a90-9ec9-7081f6eba8d2"
80
80
  },
81
81
  {
@@ -98,7 +98,7 @@
98
98
  "mathematics",
99
99
  "time"
100
100
  ],
101
- "unlocked_by": "hamming",
101
+ "unlocked_by": null,
102
102
  "uuid": "0c0511fd-59aa-4480-a7cd-4de0e9303b86"
103
103
  },
104
104
  {
@@ -111,7 +111,7 @@
111
111
  "mathematics",
112
112
  "strings"
113
113
  ],
114
- "unlocked_by": "gigasecond",
114
+ "unlocked_by": null,
115
115
  "uuid": "3d4e326d-2419-4e93-ac29-5727dbc3fbf1"
116
116
  },
117
117
  {
@@ -122,7 +122,7 @@
122
122
  "strings",
123
123
  "transforming"
124
124
  ],
125
- "unlocked_by": "raindrops",
125
+ "unlocked_by": null,
126
126
  "uuid": "99147c39-e8d3-4166-9215-c47fb4832781"
127
127
  },
128
128
  {
@@ -135,7 +135,7 @@
135
135
  "equality",
136
136
  "strings"
137
137
  ],
138
- "unlocked_by": "rna-transcription",
138
+ "unlocked_by": null,
139
139
  "uuid": "6e811b53-4eb1-40f9-a811-b5113d68ae8a"
140
140
  }
141
141
  ],
@@ -1,3 +1,3 @@
1
1
  class Raindrops {
2
- // Enter your code here
2
+ // Put your code here
3
3
  }
@@ -1,94 +1,109 @@
1
- import "package:test/test.dart";
2
- import "package:raindrops/raindrops.dart";
1
+ import 'package:test/test.dart';
2
+ import 'package:raindrops/raindrops.dart';
3
+
4
+ final Raindrops raindrops = new Raindrops();
3
5
 
4
- final raindrops = new Raindrops();
5
6
  void main() {
6
- group("identity tests", identityTests);
7
- group("factor tests", factorTests);
8
- group("multiple factor tests", multipleFactorTests);
9
- group("edge case tests", edgeCaseTests);
7
+ group('identity tests', identityTests);
8
+ group('factor tests', factorTests);
9
+ group('multiple factor tests', multipleFactorTests);
10
+ group('edge case tests', edgeCaseTests);
10
11
  }
11
12
 
12
13
  void identityTests() {
13
- test("the sound for 1 is 1", () {
14
+ test('the sound for 1 is 1', () {
14
15
  final String result = raindrops.convert(1);
15
- expect(result, equals("1"));
16
+ expect(result, equals('1'));
16
17
  }, skip: false);
17
- test("the sound for 3 is Pling", () {
18
+
19
+ test('the sound for 3 is Pling', () {
18
20
  final String result = raindrops.convert(3);
19
- expect(result, equals("Pling"));
21
+ expect(result, equals('Pling'));
20
22
  }, skip: true);
21
- test("the sound for 5 is Plang", () {
23
+
24
+ test('the sound for 5 is Plang', () {
22
25
  final String result = raindrops.convert(5);
23
- expect(result, equals("Plang"));
26
+ expect(result, equals('Plang'));
24
27
  }, skip: true);
25
- test("the sound for 7 is Plong", () {
28
+
29
+ test('the sound for 7 is Plong', () {
26
30
  final String result = raindrops.convert(7);
27
- expect(result, equals("Plong"));
31
+ expect(result, equals('Plong'));
28
32
  }, skip: true);
29
33
  }
30
34
 
31
35
  void factorTests() {
32
- test("the sound for 6 is Pling as it has a factor 3", () {
36
+ test('the sound for 6 is Pling as it has a factor 3', () {
33
37
  final String result = raindrops.convert(6);
34
- expect(result, equals("Pling"));
38
+ expect(result, equals('Pling'));
35
39
  }, skip: true);
36
- test("2 to the power 3 does not make a raindrop sound as 3 is the exponent not the base", () {
40
+
41
+ test('2 to the power 3 does not make a raindrop sound as 3 is the exponent not the base', () {
37
42
  final String result = raindrops.convert(8);
38
- expect(result, equals("8"));
43
+ expect(result, equals('8'));
39
44
  }, skip: true);
40
- test("the sound for 9 is Pling as it has a factor 3", () {
45
+
46
+ test('the sound for 9 is Pling as it has a factor 3', () {
41
47
  final String result = raindrops.convert(9);
42
- expect(result, equals("Pling"));
48
+ expect(result, equals('Pling'));
43
49
  }, skip: true);
44
- test("the sound for 10 is Plang as it has a factor 5", () {
50
+
51
+ test('the sound for 10 is Plang as it has a factor 5', () {
45
52
  final String result = raindrops.convert(10);
46
- expect(result, equals("Plang"));
53
+ expect(result, equals('Plang'));
47
54
  }, skip: true);
48
- test("the sound for 14 is Plong as it has a factor of 7", () {
55
+
56
+ test('the sound for 14 is Plong as it has a factor of 7', () {
49
57
  final String result = raindrops.convert(14);
50
- expect(result, equals("Plong"));
58
+ expect(result, equals('Plong'));
51
59
  }, skip: true);
52
60
  }
53
61
 
54
62
  void multipleFactorTests() {
55
- test("the sound for 15 is PlingPlang as it has factors 3 and 5", () {
63
+ test('the sound for 15 is PlingPlang as it has factors 3 and 5', () {
56
64
  final String result = raindrops.convert(15);
57
- expect(result, equals("PlingPlang"));
65
+ expect(result, equals('PlingPlang'));
58
66
  }, skip: true);
59
- test("the sound for 21 is PlingPlong as it has factors 3 and 7", () {
67
+
68
+ test('the sound for 21 is PlingPlong as it has factors 3 and 7', () {
60
69
  final String result = raindrops.convert(21);
61
- expect(result, equals("PlingPlong"));
70
+ expect(result, equals('PlingPlong'));
62
71
  }, skip: true);
63
- test("the sound for 35 is PlangPlong as it has factors 5 and 7", () {
72
+
73
+ test('the sound for 35 is PlangPlong as it has factors 5 and 7', () {
64
74
  final String result = raindrops.convert(35);
65
- expect(result, equals("PlangPlong"));
75
+ expect(result, equals('PlangPlong'));
66
76
  }, skip: true);
67
77
  }
68
78
 
69
79
  void edgeCaseTests() {
70
- test("the sound for 25 is Plang as it has a factor 5", () {
80
+ test('the sound for 25 is Plang as it has a factor 5', () {
71
81
  final String result = raindrops.convert(25);
72
- expect(result, equals("Plang"));
82
+ expect(result, equals('Plang'));
73
83
  }, skip: true);
74
- test("the sound for 27 is Pling as it has a factor 3", () {
84
+
85
+ test('the sound for 27 is Pling as it has a factor 3', () {
75
86
  final String result = raindrops.convert(27);
76
- expect(result, equals("Pling"));
87
+ expect(result, equals('Pling'));
77
88
  }, skip: true);
78
- test("the sound for 49 is Plong as it has a factor 7", () {
89
+
90
+ test('the sound for 49 is Plong as it has a factor 7', () {
79
91
  final String result = raindrops.convert(49);
80
- expect(result, equals("Plong"));
92
+ expect(result, equals('Plong'));
81
93
  }, skip: true);
82
- test("the sound for 52 is 52", () {
94
+
95
+ test('the sound for 52 is 52', () {
83
96
  final String result = raindrops.convert(52);
84
- expect(result, equals("52"));
97
+ expect(result, equals('52'));
85
98
  }, skip: true);
86
- test("the sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7", () {
99
+
100
+ test('the sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7', () {
87
101
  final String result = raindrops.convert(105);
88
- expect(result, equals("PlingPlangPlong"));
102
+ expect(result, equals('PlingPlangPlong'));
89
103
  }, skip: true);
90
- test("the sound for 3125 is Plang as it has a factor 5", () {
91
- final String result = raindrops.convert(3215);
92
- expect(result, equals("Plang"));
104
+
105
+ test('the sound for 3125 is Plang as it has a factor 5', () {
106
+ final String result = raindrops.convert(3125);
107
+ expect(result, equals('Plang'));
93
108
  }, skip: true);
94
109
  }
@@ -1,48 +1,41 @@
1
- import "package:test/test.dart";
2
- import "package:rna_transcription/rna_transcription.dart";
1
+ import 'package:test/test.dart';
2
+ import 'package:rna_transcription/rna_transcription.dart';
3
3
 
4
4
  void main() {
5
- final rnaTranscription = new RnaTranscription();
6
-
7
- group("RnaTranscription", () {
8
- group("#toRna()", () {
9
- test("transcribes cytosine to guanine", () {
10
- final result = rnaTranscription.toRna("C");
11
-
12
- expect(result, equals("G"));
13
- }, skip: false);
14
-
15
- test("transcribes guanine to cytosine", () {
16
- final result = rnaTranscription.toRna("G");
17
-
18
- expect(result, equals("C"));
19
- }, skip: true);
20
-
21
- test("transcribes adenine to uracil", () {
22
- final result = rnaTranscription.toRna("A");
23
-
24
- expect(result, equals("U"));
25
- }, skip: true);
26
-
27
- test("transcribes thymine to adenine", () {
28
- final result = rnaTranscription.toRna("T");
29
-
30
- expect(result, equals("A"));
31
- }, skip: true);
32
-
33
- test("transcribes all dna nucleotides to their rna complements", () {
34
- final result = rnaTranscription.toRna("ACGTGGTCTTAA");
35
-
36
- expect(result, equals("UGCACCAGAAUU"));
37
- }, skip: true);
38
-
39
- test("correctly handles completely invalid input", () {
40
- expect(() => rnaTranscription.toRna("XXX"), throwsArgumentError);
41
- }, skip: true);
42
-
43
- test("correctly handles partially invalid input", () {
44
- expect(() => rnaTranscription.toRna("ACGTXXXCTTAA"), throwsArgumentError);
45
- }, skip: true);
46
- });
5
+ final RnaTranscription rnaTranscription = new RnaTranscription();
6
+
7
+ group('RnaTranscription', () {
8
+ test('transcribes cytosine to guanine', () {
9
+ final String result = rnaTranscription.toRna('C');
10
+ expect(result, equals('G'));
11
+ }, skip: false);
12
+
13
+ test('transcribes guanine to cytosine', () {
14
+ final String result = rnaTranscription.toRna('G');
15
+ expect(result, equals('C'));
16
+ }, skip: true);
17
+
18
+ test('transcribes adenine to uracil', () {
19
+ final String result = rnaTranscription.toRna('A');
20
+ expect(result, equals('U'));
21
+ }, skip: true);
22
+
23
+ test('transcribes thymine to adenine', () {
24
+ final String result = rnaTranscription.toRna('T');
25
+ expect(result, equals('A'));
26
+ }, skip: true);
27
+
28
+ test('transcribes all dna nucleotides to their rna complements', () {
29
+ final String result = rnaTranscription.toRna('ACGTGGTCTTAA');
30
+ expect(result, equals('UGCACCAGAAUU'));
31
+ }, skip: true);
32
+
33
+ test('correctly handles completely invalid input', () {
34
+ expect(() => rnaTranscription.toRna('XXX'), throwsArgumentError);
35
+ }, skip: true);
36
+
37
+ test('correctly handles partially invalid input', () {
38
+ expect(() => rnaTranscription.toRna('ACGTXXXCTTAA'), throwsArgumentError);
39
+ }, skip: true);
47
40
  });
48
41
  }
@@ -1,13 +1,13 @@
1
1
  module GoCounting
2
2
 
3
- type Color = Black | White
3
+ type Owner = None | Black | White
4
4
  type Coord = int * int
5
- type Board = Color option [,]
5
+ type Board = Owner [,]
6
6
 
7
- let charToColor =
7
+ let charToOwner =
8
8
  function
9
- | 'B' -> Some Black
10
- | 'W' -> Some White
9
+ | 'B' -> Black
10
+ | 'W' -> White
11
11
  | _ -> None
12
12
 
13
13
  let cols (board: Board) = board.GetUpperBound 0 + 1
@@ -44,17 +44,17 @@ let mkBoard (input: string list) =
44
44
  let rows = input.Length
45
45
  let cols = input.[0].Length
46
46
 
47
- Array2D.init cols rows (fun col row -> charToColor input.[row].[col])
47
+ Array2D.init cols rows (fun col row -> charToOwner input.[row].[col])
48
48
 
49
49
  let territoryOwner (board: Board) (coords: Set<Coord>) =
50
50
  let uniqueNeighborColors =
51
51
  coords
52
52
  |> Seq.collect (nonEmptyNeighborCoordinates board)
53
- |> Seq.choose (color board)
53
+ |> Seq.map (color board)
54
54
  |> set
55
55
 
56
- if uniqueNeighborColors.Count = 1 then Some (Seq.head uniqueNeighborColors)
57
- else None
56
+ if uniqueNeighborColors.Count = 1 then Seq.head uniqueNeighborColors
57
+ else Owner.None
58
58
 
59
59
  let rec territoryHelper board remainder acc =
60
60
  match remainder with
@@ -72,28 +72,32 @@ let rec territoryHelper board remainder acc =
72
72
 
73
73
  territoryHelper board newRemainder newAcc
74
74
 
75
- let territory board coord =
75
+ let territoryCoordinates board coord =
76
76
  if isValidCoordinate board coord && isEmpty board coord then territoryHelper board [coord] (Set.singleton coord)
77
77
  else Set.empty
78
78
 
79
- let territoryFor input coord =
79
+ let territory input coordinate =
80
80
  let board = mkBoard input
81
- let coords = territory board coord
82
- let owner = territoryOwner board coords
83
-
84
- if Set.isEmpty coords then None else Some (owner, Set.toList coords)
81
+
82
+ if not (isValidCoordinate board coordinate) then
83
+ Option.None
84
+ else
85
+ let coords = territoryCoordinates board coordinate
86
+ let owner = territoryOwner board coords
87
+ Some (owner, Set.toList coords)
85
88
 
86
89
  let rec territoriesHelper board remainder acc =
87
90
  match remainder with
88
91
  | [] -> acc
89
92
  | coord :: _ ->
90
- let coords = territory board coord
93
+ let coords = territoryCoordinates board coord
91
94
  let owner = territoryOwner board coords
92
- let remainder = Set.difference (Set.ofList remainder) coords |> Set.toList
93
-
94
- territoriesHelper board remainder (Map.add owner (Set.toList coords) acc)
95
+ let remainder = Set.difference (Set.ofList remainder) coords |> Set.toList
96
+ let updatedOwnedTerritories = Map.find owner acc @ Set.toList coords
97
+ territoriesHelper board remainder (Map.add owner updatedOwnedTerritories acc)
95
98
 
96
99
  let territories input =
97
100
  let board = mkBoard input
98
101
  let emptyCoords = emptyCoordinates board
99
- territoriesHelper board emptyCoords Map.empty
102
+ let startMap = Map.ofList [(Owner.None, []); (Owner.Black, []); (Owner.White, [])]
103
+ territoriesHelper board emptyCoords startMap