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.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/ceylon/.travis.yml +1 -0
  4. data/tracks/ceylon/bin/compile-all-stubs +16 -0
  5. data/tracks/ceylon/config.json +11 -0
  6. data/tracks/ceylon/exercises/react/example/Reactor.ceylon +96 -0
  7. data/tracks/ceylon/exercises/react/example/module.ceylon +4 -0
  8. data/tracks/ceylon/exercises/react/source/react/Reactor.ceylon +29 -0
  9. data/tracks/ceylon/exercises/react/source/react/ReactorTest.ceylon +195 -0
  10. data/tracks/ceylon/exercises/react/source/react/module.ceylon +3 -0
  11. data/tracks/csharp/config.json +9 -0
  12. data/tracks/csharp/exercises/pov/Example.cs +17 -17
  13. data/tracks/csharp/exercises/zipper/Example.cs +137 -0
  14. data/tracks/csharp/exercises/zipper/ZipperTest.cs +83 -0
  15. data/tracks/go/config.json +9 -0
  16. data/tracks/go/exercises/transpose/cases_test.go +247 -0
  17. data/tracks/go/exercises/transpose/example.go +25 -0
  18. data/tracks/go/exercises/transpose/example_gen.go +54 -0
  19. data/tracks/go/exercises/transpose/transpose_test.go +39 -0
  20. data/tracks/go/exercises/triangle/triangle.go +1 -1
  21. data/tracks/haskell/.travis.yml +2 -2
  22. data/tracks/haskell/common/stack.yaml +1 -1
  23. data/tracks/haskell/exercises/accumulate/stack.yaml +1 -1
  24. data/tracks/haskell/exercises/all-your-base/stack.yaml +1 -1
  25. data/tracks/haskell/exercises/allergies/stack.yaml +1 -1
  26. data/tracks/haskell/exercises/alphametics/stack.yaml +1 -1
  27. data/tracks/haskell/exercises/anagram/stack.yaml +1 -1
  28. data/tracks/haskell/exercises/atbash-cipher/stack.yaml +1 -1
  29. data/tracks/haskell/exercises/bank-account/stack.yaml +1 -1
  30. data/tracks/haskell/exercises/beer-song/stack.yaml +1 -1
  31. data/tracks/haskell/exercises/binary-search-tree/stack.yaml +1 -1
  32. data/tracks/haskell/exercises/binary/stack.yaml +1 -1
  33. data/tracks/haskell/exercises/bob/stack.yaml +1 -1
  34. data/tracks/haskell/exercises/bowling/stack.yaml +1 -1
  35. data/tracks/haskell/exercises/change/stack.yaml +1 -1
  36. data/tracks/haskell/exercises/clock/stack.yaml +1 -1
  37. data/tracks/haskell/exercises/connect/stack.yaml +1 -1
  38. data/tracks/haskell/exercises/crypto-square/stack.yaml +1 -1
  39. data/tracks/haskell/exercises/custom-set/stack.yaml +1 -1
  40. data/tracks/haskell/exercises/difference-of-squares/stack.yaml +1 -1
  41. data/tracks/haskell/exercises/dominoes/stack.yaml +1 -1
  42. data/tracks/haskell/exercises/etl/stack.yaml +1 -1
  43. data/tracks/haskell/exercises/food-chain/stack.yaml +1 -1
  44. data/tracks/haskell/exercises/forth/stack.yaml +1 -1
  45. data/tracks/haskell/exercises/gigasecond/stack.yaml +1 -1
  46. data/tracks/haskell/exercises/go-counting/stack.yaml +1 -1
  47. data/tracks/haskell/exercises/grade-school/stack.yaml +1 -1
  48. data/tracks/haskell/exercises/grains/stack.yaml +1 -1
  49. data/tracks/haskell/exercises/hamming/stack.yaml +1 -1
  50. data/tracks/haskell/exercises/hexadecimal/stack.yaml +1 -1
  51. data/tracks/haskell/exercises/house/stack.yaml +1 -1
  52. data/tracks/haskell/exercises/kindergarten-garden/stack.yaml +1 -1
  53. data/tracks/haskell/exercises/largest-series-product/stack.yaml +1 -1
  54. data/tracks/haskell/exercises/leap/stack.yaml +1 -1
  55. data/tracks/haskell/exercises/lens-person/stack.yaml +1 -1
  56. data/tracks/haskell/exercises/linked-list/stack.yaml +1 -1
  57. data/tracks/haskell/exercises/list-ops/stack.yaml +1 -1
  58. data/tracks/haskell/exercises/luhn/stack.yaml +1 -1
  59. data/tracks/haskell/exercises/matrix/stack.yaml +1 -1
  60. data/tracks/haskell/exercises/meetup/stack.yaml +1 -1
  61. data/tracks/haskell/exercises/minesweeper/stack.yaml +1 -1
  62. data/tracks/haskell/exercises/nth-prime/stack.yaml +1 -1
  63. data/tracks/haskell/exercises/nucleotide-count/stack.yaml +1 -1
  64. data/tracks/haskell/exercises/ocr-numbers/stack.yaml +1 -1
  65. data/tracks/haskell/exercises/octal/stack.yaml +1 -1
  66. data/tracks/haskell/exercises/palindrome-products/stack.yaml +1 -1
  67. data/tracks/haskell/exercises/parallel-letter-frequency/stack.yaml +1 -1
  68. data/tracks/haskell/exercises/pascals-triangle/stack.yaml +1 -1
  69. data/tracks/haskell/exercises/phone-number/stack.yaml +1 -1
  70. data/tracks/haskell/exercises/pig-latin/stack.yaml +1 -1
  71. data/tracks/haskell/exercises/pov/stack.yaml +1 -1
  72. data/tracks/haskell/exercises/prime-factors/stack.yaml +1 -1
  73. data/tracks/haskell/exercises/pythagorean-triplet/stack.yaml +1 -1
  74. data/tracks/haskell/exercises/queen-attack/stack.yaml +1 -1
  75. data/tracks/haskell/exercises/raindrops/stack.yaml +1 -1
  76. data/tracks/haskell/exercises/rna-transcription/stack.yaml +1 -1
  77. data/tracks/haskell/exercises/robot-name/stack.yaml +1 -1
  78. data/tracks/haskell/exercises/robot-simulator/stack.yaml +1 -1
  79. data/tracks/haskell/exercises/roman-numerals/stack.yaml +1 -1
  80. data/tracks/haskell/exercises/run-length-encoding/stack.yaml +1 -1
  81. data/tracks/haskell/exercises/saddle-points/stack.yaml +1 -1
  82. data/tracks/haskell/exercises/say/stack.yaml +1 -1
  83. data/tracks/haskell/exercises/scrabble-score/stack.yaml +1 -1
  84. data/tracks/haskell/exercises/secret-handshake/stack.yaml +1 -1
  85. data/tracks/haskell/exercises/series/stack.yaml +1 -1
  86. data/tracks/haskell/exercises/sgf-parsing/stack.yaml +1 -1
  87. data/tracks/haskell/exercises/sieve/stack.yaml +1 -1
  88. data/tracks/haskell/exercises/simple-cipher/stack.yaml +1 -1
  89. data/tracks/haskell/exercises/simple-linked-list/stack.yaml +1 -1
  90. data/tracks/haskell/exercises/space-age/stack.yaml +1 -1
  91. data/tracks/haskell/exercises/strain/stack.yaml +1 -1
  92. data/tracks/haskell/exercises/sublist/stack.yaml +1 -1
  93. data/tracks/haskell/exercises/sum-of-multiples/stack.yaml +1 -1
  94. data/tracks/haskell/exercises/triangle/stack.yaml +1 -1
  95. data/tracks/haskell/exercises/trinary/stack.yaml +1 -1
  96. data/tracks/haskell/exercises/word-count/stack.yaml +1 -1
  97. data/tracks/haskell/exercises/wordy/stack.yaml +1 -1
  98. data/tracks/haskell/exercises/zebra-puzzle/stack.yaml +1 -1
  99. data/tracks/haskell/exercises/zipper/stack.yaml +1 -1
  100. data/tracks/lua/exercises/list-ops/list-ops_spec.lua +1 -1
  101. data/tracks/objective-c/config.json +9 -0
  102. data/tracks/objective-c/exercises/beer-song/BeerSongExample.h +7 -0
  103. data/tracks/objective-c/exercises/beer-song/BeerSongExample.m +56 -0
  104. data/tracks/objective-c/exercises/beer-song/BeerSongTest.m +51 -0
  105. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +23 -1
  106. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/OCLint.xcscheme +1 -1
  107. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/xobjectivecTest.xcscheme +1 -1
  108. data/tracks/perl6/config.json +5 -0
  109. data/tracks/perl6/exercises/grade-school/Example.pm +17 -0
  110. data/tracks/perl6/exercises/grade-school/grade-school.t +32 -0
  111. data/tracks/scala/config.json +6 -0
  112. data/tracks/scala/exercises/rna-transcription/build.sbt +2 -2
  113. data/tracks/scala/exercises/sublist/build.sbt +2 -2
  114. data/tracks/scala/exercises/sublist/src/test/scala/SublistTest.scala +1 -1
  115. metadata +19 -2
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -63,7 +63,7 @@ describe('list-ops', function()
63
63
  describe('filter', function()
64
64
  local function always_true() return true end
65
65
  local function always_false() return false end
66
- local function is_even(x) return x %2 == 0 end
66
+ local function is_even(x) return x % 2 == 0 end
67
67
 
68
68
  it('should return an empty array and not call the predicate when the input is an empty array', function()
69
69
  assert.same({}, filter({}, should_not_be_called))
@@ -169,6 +169,15 @@
169
169
  "Transforming"
170
170
  ]
171
171
  },
172
+ {
173
+ "difficulty": 4,
174
+ "slug": "beer-song",
175
+ "topics": [
176
+ "Looping",
177
+ "Conditionals",
178
+ "Strings"
179
+ ]
180
+ },
172
181
  {
173
182
  "difficulty": 4,
174
183
  "slug": "word-count",
@@ -0,0 +1,7 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ @interface BeerSongExample : NSObject
4
+
5
+ -(instancetype)initWithNumberOfBeerBottles:(int)numberOfBottles;
6
+ -(NSString*)singBeerSong;
7
+ @end
@@ -0,0 +1,56 @@
1
+ #import "BeerSongExample.h"
2
+
3
+ @interface BeerSongExample ()
4
+
5
+ @property(nonatomic,assign) int numberOfBeerBottles;
6
+
7
+ @end
8
+
9
+ @implementation BeerSongExample
10
+
11
+ -(instancetype)initWithNumberOfBeerBottles:(int)numberOfBottles{
12
+ self = [super init];
13
+
14
+ if(self){
15
+
16
+ self.numberOfBeerBottles = numberOfBottles;
17
+ }
18
+
19
+ return self;
20
+ }
21
+
22
+ -(NSString*)singBeerSong{
23
+
24
+ int numberOfBottles = self.numberOfBeerBottles;
25
+ NSMutableString *verses = [NSMutableString string];
26
+ while (numberOfBottles > 2) {
27
+
28
+ [verses appendFormat:@"%d bottles of beer on the wall, %d bottles of beer.\n",numberOfBottles,numberOfBottles];
29
+ numberOfBottles--;
30
+ [verses appendFormat:@"Take one down and pass it around, %d bottles of beer on the wall.\n\n",numberOfBottles];
31
+ }
32
+
33
+ while(numberOfBottles <= 2){
34
+
35
+ switch(numberOfBottles){
36
+
37
+ case 2: [verses appendFormat:@"%d bottles of beer on the wall, %d bottles of beer.\n",numberOfBottles,numberOfBottles];
38
+ numberOfBottles--;
39
+ [verses appendFormat:@"Take one down and pass it around, %d bottle of beer on the wall.\n\n",numberOfBottles];
40
+ break;
41
+
42
+ case 1:[verses appendFormat:@"%d bottle of beer on the wall, %d bottle of beer.\n",numberOfBottles,numberOfBottles];
43
+ numberOfBottles--;
44
+ [verses appendString:@"Take one down and pass it around, no more bottles of beer on the wall.\n\n"];
45
+ break;
46
+
47
+ case 0: [verses appendString:@"No more bottles of beer on the wall, no more bottles of beer.\n"];
48
+ numberOfBottles+=99;
49
+ [verses appendFormat:@"Go to the store and buy some more, %d bottles of beer on the wall.",numberOfBottles];
50
+ break;
51
+ }
52
+ }
53
+
54
+ return verses;
55
+ }
56
+ @end
@@ -0,0 +1,51 @@
1
+ #import <XCTest/XCTest.h>
2
+
3
+ #if __has_include("BeerSongExample.h")
4
+ # import "BeerSongExample.h"
5
+ # else
6
+ # import "BeerSong.h"
7
+ #endif
8
+
9
+ @interface BeerSongTest : XCTestCase
10
+
11
+ @end
12
+
13
+ @implementation BeerSongTest
14
+
15
+ - (void)testVerseForZeroBeerBottles {
16
+
17
+ BeerSongExample *songExample = [[BeerSongExample alloc]initWithNumberOfBeerBottles:0];
18
+ NSString* expectedVerse = @"No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.";
19
+ XCTAssertEqualObjects(expectedVerse, [songExample singBeerSong]);
20
+
21
+ }
22
+
23
+ -(void)testVersesForOneBeerBottle{
24
+ BeerSongExample *songExample = [[BeerSongExample alloc]initWithNumberOfBeerBottles:1];
25
+ NSString* expectedVerses = @"1 bottle of beer on the wall, 1 bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.";
26
+ XCTAssertEqualObjects(expectedVerses, [songExample singBeerSong]);
27
+
28
+ }
29
+
30
+ -(void)testVersesForTwoBeerBottles{
31
+
32
+ BeerSongExample *songExample = [[BeerSongExample alloc]initWithNumberOfBeerBottles:2];
33
+ NSString* expectedVerses = @"2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.";
34
+ XCTAssertEqualObjects(expectedVerses, [songExample singBeerSong]);
35
+ }
36
+
37
+ -(void)testVersesForSeventyFiveBeerBottles{
38
+
39
+ BeerSongExample *songExample = [[BeerSongExample alloc]initWithNumberOfBeerBottles:75];
40
+ NSString* expectedVerses = @"75 bottles of beer on the wall, 75 bottles of beer.\nTake one down and pass it around, 74 bottles of beer on the wall.\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down and pass it around, 73 bottles of beer on the wall.\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down and pass it around, 72 bottles of beer on the wall.\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down and pass it around, 71 bottles of beer on the wall.\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down and pass it around, 70 bottles of beer on the wall.\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down and pass it around, 69 bottles of beer on the wall.\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down and pass it around, 68 bottles of beer on the wall.\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down and pass it around, 67 bottles of beer on the wall.\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down and pass it around, 66 bottles of beer on the wall.\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down and pass it around, 65 bottles of beer on the wall.\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down and pass it around, 64 bottles of beer on the wall.\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down and pass it around, 63 bottles of beer on the wall.\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down and pass it around, 62 bottles of beer on the wall.\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down and pass it around, 61 bottles of beer on the wall.\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down and pass it around, 60 bottles of beer on the wall.\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down and pass it around, 59 bottles of beer on the wall.\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down and pass it around, 58 bottles of beer on the wall.\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down and pass it around, 57 bottles of beer on the wall.\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down and pass it around, 56 bottles of beer on the wall.\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTake one down and pass it around, 55 bottles of beer on the wall.\n\n55 bottles of beer on the wall, 55 bottles of beer.\nTake one down and pass it around, 54 bottles of beer on the wall.\n\n54 bottles of beer on the wall, 54 bottles of beer.\nTake one down and pass it around, 53 bottles of beer on the wall.\n\n53 bottles of beer on the wall, 53 bottles of beer.\nTake one down and pass it around, 52 bottles of beer on the wall.\n\n52 bottles of beer on the wall, 52 bottles of beer.\nTake one down and pass it around, 51 bottles of beer on the wall.\n\n51 bottles of beer on the wall, 51 bottles of beer.\nTake one down and pass it around, 50 bottles of beer on the wall.\n\n50 bottles of beer on the wall, 50 bottles of beer.\nTake one down and pass it around, 49 bottles of beer on the wall.\n\n49 bottles of beer on the wall, 49 bottles of beer.\nTake one down and pass it around, 48 bottles of beer on the wall.\n\n48 bottles of beer on the wall, 48 bottles of beer.\nTake one down and pass it around, 47 bottles of beer on the wall.\n\n47 bottles of beer on the wall, 47 bottles of beer.\nTake one down and pass it around, 46 bottles of beer on the wall.\n\n46 bottles of beer on the wall, 46 bottles of beer.\nTake one down and pass it around, 45 bottles of beer on the wall.\n\n45 bottles of beer on the wall, 45 bottles of beer.\nTake one down and pass it around, 44 bottles of beer on the wall.\n\n44 bottles of beer on the wall, 44 bottles of beer.\nTake one down and pass it around, 43 bottles of beer on the wall.\n\n43 bottles of beer on the wall, 43 bottles of beer.\nTake one down and pass it around, 42 bottles of beer on the wall.\n\n42 bottles of beer on the wall, 42 bottles of beer.\nTake one down and pass it around, 41 bottles of beer on the wall.\n\n41 bottles of beer on the wall, 41 bottles of beer.\nTake one down and pass it around, 40 bottles of beer on the wall.\n\n40 bottles of beer on the wall, 40 bottles of beer.\nTake one down and pass it around, 39 bottles of beer on the wall.\n\n39 bottles of beer on the wall, 39 bottles of beer.\nTake one down and pass it around, 38 bottles of beer on the wall.\n\n38 bottles of beer on the wall, 38 bottles of beer.\nTake one down and pass it around, 37 bottles of beer on the wall.\n\n37 bottles of beer on the wall, 37 bottles of beer.\nTake one down and pass it around, 36 bottles of beer on the wall.\n\n36 bottles of beer on the wall, 36 bottles of beer.\nTake one down and pass it around, 35 bottles of beer on the wall.\n\n35 bottles of beer on the wall, 35 bottles of beer.\nTake one down and pass it around, 34 bottles of beer on the wall.\n\n34 bottles of beer on the wall, 34 bottles of beer.\nTake one down and pass it around, 33 bottles of beer on the wall.\n\n33 bottles of beer on the wall, 33 bottles of beer.\nTake one down and pass it around, 32 bottles of beer on the wall.\n\n32 bottles of beer on the wall, 32 bottles of beer.\nTake one down and pass it around, 31 bottles of beer on the wall.\n\n31 bottles of beer on the wall, 31 bottles of beer.\nTake one down and pass it around, 30 bottles of beer on the wall.\n\n30 bottles of beer on the wall, 30 bottles of beer.\nTake one down and pass it around, 29 bottles of beer on the wall.\n\n29 bottles of beer on the wall, 29 bottles of beer.\nTake one down and pass it around, 28 bottles of beer on the wall.\n\n28 bottles of beer on the wall, 28 bottles of beer.\nTake one down and pass it around, 27 bottles of beer on the wall.\n\n27 bottles of beer on the wall, 27 bottles of beer.\nTake one down and pass it around, 26 bottles of beer on the wall.\n\n26 bottles of beer on the wall, 26 bottles of beer.\nTake one down and pass it around, 25 bottles of beer on the wall.\n\n25 bottles of beer on the wall, 25 bottles of beer.\nTake one down and pass it around, 24 bottles of beer on the wall.\n\n24 bottles of beer on the wall, 24 bottles of beer.\nTake one down and pass it around, 23 bottles of beer on the wall.\n\n23 bottles of beer on the wall, 23 bottles of beer.\nTake one down and pass it around, 22 bottles of beer on the wall.\n\n22 bottles of beer on the wall, 22 bottles of beer.\nTake one down and pass it around, 21 bottles of beer on the wall.\n\n21 bottles of beer on the wall, 21 bottles of beer.\nTake one down and pass it around, 20 bottles of beer on the wall.\n\n20 bottles of beer on the wall, 20 bottles of beer.\nTake one down and pass it around, 19 bottles of beer on the wall.\n\n19 bottles of beer on the wall, 19 bottles of beer.\nTake one down and pass it around, 18 bottles of beer on the wall.\n\n18 bottles of beer on the wall, 18 bottles of beer.\nTake one down and pass it around, 17 bottles of beer on the wall.\n\n17 bottles of beer on the wall, 17 bottles of beer.\nTake one down and pass it around, 16 bottles of beer on the wall.\n\n16 bottles of beer on the wall, 16 bottles of beer.\nTake one down and pass it around, 15 bottles of beer on the wall.\n\n15 bottles of beer on the wall, 15 bottles of beer.\nTake one down and pass it around, 14 bottles of beer on the wall.\n\n14 bottles of beer on the wall, 14 bottles of beer.\nTake one down and pass it around, 13 bottles of beer on the wall.\n\n13 bottles of beer on the wall, 13 bottles of beer.\nTake one down and pass it around, 12 bottles of beer on the wall.\n\n12 bottles of beer on the wall, 12 bottles of beer.\nTake one down and pass it around, 11 bottles of beer on the wall.\n\n11 bottles of beer on the wall, 11 bottles of beer.\nTake one down and pass it around, 10 bottles of beer on the wall.\n\n10 bottles of beer on the wall, 10 bottles of beer.\nTake one down and pass it around, 9 bottles of beer on the wall.\n\n9 bottles of beer on the wall, 9 bottles of beer.\nTake one down and pass it around, 8 bottles of beer on the wall.\n\n8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n\n5 bottles of beer on the wall, 5 bottles of beer.\nTake one down and pass it around, 4 bottles of beer on the wall.\n\n4 bottles of beer on the wall, 4 bottles of beer.\nTake one down and pass it around, 3 bottles of beer on the wall.\n\n3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.";
41
+ XCTAssertEqualObjects(expectedVerses, [songExample singBeerSong]);
42
+ }
43
+
44
+ -(void)testAllVersesOfBeerSong{
45
+
46
+ BeerSongExample *songExample = [[BeerSongExample alloc]initWithNumberOfBeerBottles:99];
47
+ NSString* expectedVerses = @"99 bottles of beer on the wall, 99 bottles of beer.\nTake one down and pass it around, 98 bottles of beer on the wall.\n\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down and pass it around, 97 bottles of beer on the wall.\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down and pass it around, 96 bottles of beer on the wall.\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down and pass it around, 95 bottles of beer on the wall.\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down and pass it around, 94 bottles of beer on the wall.\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down and pass it around, 93 bottles of beer on the wall.\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down and pass it around, 92 bottles of beer on the wall.\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down and pass it around, 91 bottles of beer on the wall.\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down and pass it around, 90 bottles of beer on the wall.\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down and pass it around, 89 bottles of beer on the wall.\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down and pass it around, 88 bottles of beer on the wall.\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down and pass it around, 87 bottles of beer on the wall.\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down and pass it around, 86 bottles of beer on the wall.\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down and pass it around, 85 bottles of beer on the wall.\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down and pass it around, 84 bottles of beer on the wall.\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down and pass it around, 83 bottles of beer on the wall.\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down and pass it around, 82 bottles of beer on the wall.\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down and pass it around, 81 bottles of beer on the wall.\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down and pass it around, 80 bottles of beer on the wall.\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down and pass it around, 79 bottles of beer on the wall.\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down and pass it around, 78 bottles of beer on the wall.\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down and pass it around, 77 bottles of beer on the wall.\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down and pass it around, 76 bottles of beer on the wall.\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down and pass it around, 75 bottles of beer on the wall.\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down and pass it around, 74 bottles of beer on the wall.\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down and pass it around, 73 bottles of beer on the wall.\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down and pass it around, 72 bottles of beer on the wall.\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down and pass it around, 71 bottles of beer on the wall.\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down and pass it around, 70 bottles of beer on the wall.\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down and pass it around, 69 bottles of beer on the wall.\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down and pass it around, 68 bottles of beer on the wall.\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down and pass it around, 67 bottles of beer on the wall.\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down and pass it around, 66 bottles of beer on the wall.\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down and pass it around, 65 bottles of beer on the wall.\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down and pass it around, 64 bottles of beer on the wall.\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down and pass it around, 63 bottles of beer on the wall.\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down and pass it around, 62 bottles of beer on the wall.\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down and pass it around, 61 bottles of beer on the wall.\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down and pass it around, 60 bottles of beer on the wall.\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down and pass it around, 59 bottles of beer on the wall.\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down and pass it around, 58 bottles of beer on the wall.\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down and pass it around, 57 bottles of beer on the wall.\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down and pass it around, 56 bottles of beer on the wall.\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTake one down and pass it around, 55 bottles of beer on the wall.\n\n55 bottles of beer on the wall, 55 bottles of beer.\nTake one down and pass it around, 54 bottles of beer on the wall.\n\n54 bottles of beer on the wall, 54 bottles of beer.\nTake one down and pass it around, 53 bottles of beer on the wall.\n\n53 bottles of beer on the wall, 53 bottles of beer.\nTake one down and pass it around, 52 bottles of beer on the wall.\n\n52 bottles of beer on the wall, 52 bottles of beer.\nTake one down and pass it around, 51 bottles of beer on the wall.\n\n51 bottles of beer on the wall, 51 bottles of beer.\nTake one down and pass it around, 50 bottles of beer on the wall.\n\n50 bottles of beer on the wall, 50 bottles of beer.\nTake one down and pass it around, 49 bottles of beer on the wall.\n\n49 bottles of beer on the wall, 49 bottles of beer.\nTake one down and pass it around, 48 bottles of beer on the wall.\n\n48 bottles of beer on the wall, 48 bottles of beer.\nTake one down and pass it around, 47 bottles of beer on the wall.\n\n47 bottles of beer on the wall, 47 bottles of beer.\nTake one down and pass it around, 46 bottles of beer on the wall.\n\n46 bottles of beer on the wall, 46 bottles of beer.\nTake one down and pass it around, 45 bottles of beer on the wall.\n\n45 bottles of beer on the wall, 45 bottles of beer.\nTake one down and pass it around, 44 bottles of beer on the wall.\n\n44 bottles of beer on the wall, 44 bottles of beer.\nTake one down and pass it around, 43 bottles of beer on the wall.\n\n43 bottles of beer on the wall, 43 bottles of beer.\nTake one down and pass it around, 42 bottles of beer on the wall.\n\n42 bottles of beer on the wall, 42 bottles of beer.\nTake one down and pass it around, 41 bottles of beer on the wall.\n\n41 bottles of beer on the wall, 41 bottles of beer.\nTake one down and pass it around, 40 bottles of beer on the wall.\n\n40 bottles of beer on the wall, 40 bottles of beer.\nTake one down and pass it around, 39 bottles of beer on the wall.\n\n39 bottles of beer on the wall, 39 bottles of beer.\nTake one down and pass it around, 38 bottles of beer on the wall.\n\n38 bottles of beer on the wall, 38 bottles of beer.\nTake one down and pass it around, 37 bottles of beer on the wall.\n\n37 bottles of beer on the wall, 37 bottles of beer.\nTake one down and pass it around, 36 bottles of beer on the wall.\n\n36 bottles of beer on the wall, 36 bottles of beer.\nTake one down and pass it around, 35 bottles of beer on the wall.\n\n35 bottles of beer on the wall, 35 bottles of beer.\nTake one down and pass it around, 34 bottles of beer on the wall.\n\n34 bottles of beer on the wall, 34 bottles of beer.\nTake one down and pass it around, 33 bottles of beer on the wall.\n\n33 bottles of beer on the wall, 33 bottles of beer.\nTake one down and pass it around, 32 bottles of beer on the wall.\n\n32 bottles of beer on the wall, 32 bottles of beer.\nTake one down and pass it around, 31 bottles of beer on the wall.\n\n31 bottles of beer on the wall, 31 bottles of beer.\nTake one down and pass it around, 30 bottles of beer on the wall.\n\n30 bottles of beer on the wall, 30 bottles of beer.\nTake one down and pass it around, 29 bottles of beer on the wall.\n\n29 bottles of beer on the wall, 29 bottles of beer.\nTake one down and pass it around, 28 bottles of beer on the wall.\n\n28 bottles of beer on the wall, 28 bottles of beer.\nTake one down and pass it around, 27 bottles of beer on the wall.\n\n27 bottles of beer on the wall, 27 bottles of beer.\nTake one down and pass it around, 26 bottles of beer on the wall.\n\n26 bottles of beer on the wall, 26 bottles of beer.\nTake one down and pass it around, 25 bottles of beer on the wall.\n\n25 bottles of beer on the wall, 25 bottles of beer.\nTake one down and pass it around, 24 bottles of beer on the wall.\n\n24 bottles of beer on the wall, 24 bottles of beer.\nTake one down and pass it around, 23 bottles of beer on the wall.\n\n23 bottles of beer on the wall, 23 bottles of beer.\nTake one down and pass it around, 22 bottles of beer on the wall.\n\n22 bottles of beer on the wall, 22 bottles of beer.\nTake one down and pass it around, 21 bottles of beer on the wall.\n\n21 bottles of beer on the wall, 21 bottles of beer.\nTake one down and pass it around, 20 bottles of beer on the wall.\n\n20 bottles of beer on the wall, 20 bottles of beer.\nTake one down and pass it around, 19 bottles of beer on the wall.\n\n19 bottles of beer on the wall, 19 bottles of beer.\nTake one down and pass it around, 18 bottles of beer on the wall.\n\n18 bottles of beer on the wall, 18 bottles of beer.\nTake one down and pass it around, 17 bottles of beer on the wall.\n\n17 bottles of beer on the wall, 17 bottles of beer.\nTake one down and pass it around, 16 bottles of beer on the wall.\n\n16 bottles of beer on the wall, 16 bottles of beer.\nTake one down and pass it around, 15 bottles of beer on the wall.\n\n15 bottles of beer on the wall, 15 bottles of beer.\nTake one down and pass it around, 14 bottles of beer on the wall.\n\n14 bottles of beer on the wall, 14 bottles of beer.\nTake one down and pass it around, 13 bottles of beer on the wall.\n\n13 bottles of beer on the wall, 13 bottles of beer.\nTake one down and pass it around, 12 bottles of beer on the wall.\n\n12 bottles of beer on the wall, 12 bottles of beer.\nTake one down and pass it around, 11 bottles of beer on the wall.\n\n11 bottles of beer on the wall, 11 bottles of beer.\nTake one down and pass it around, 10 bottles of beer on the wall.\n\n10 bottles of beer on the wall, 10 bottles of beer.\nTake one down and pass it around, 9 bottles of beer on the wall.\n\n9 bottles of beer on the wall, 9 bottles of beer.\nTake one down and pass it around, 8 bottles of beer on the wall.\n\n8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n\n5 bottles of beer on the wall, 5 bottles of beer.\nTake one down and pass it around, 4 bottles of beer on the wall.\n\n4 bottles of beer on the wall, 4 bottles of beer.\nTake one down and pass it around, 3 bottles of beer on the wall.\n\n3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.";
48
+ XCTAssertEqualObjects(expectedVerses, [songExample singBeerSong]);
49
+ }
50
+
51
+ @end
@@ -47,6 +47,8 @@
47
47
  1EFACABA1CCCAF3D006F2E69 /* SpaceAgeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EFACA9F1CCCAF3D006F2E69 /* SpaceAgeTest.m */; };
48
48
  1EFACABB1CCCAF3D006F2E69 /* WordCountExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EFACAA11CCCAF3D006F2E69 /* WordCountExample.m */; };
49
49
  1EFACABC1CCCAF3D006F2E69 /* WordCountTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EFACAA21CCCAF3D006F2E69 /* WordCountTest.m */; };
50
+ A065F5781E3098080048E337 /* BeerSongExample.m in Sources */ = {isa = PBXBuildFile; fileRef = A065F5761E3098080048E337 /* BeerSongExample.m */; };
51
+ A065F5791E3098080048E337 /* BeerSongTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A065F5771E3098080048E337 /* BeerSongTest.m */; };
50
52
  E907D0CA1D6B731600106C42 /* GigasecondExample.m in Sources */ = {isa = PBXBuildFile; fileRef = E907D0C91D6B731600106C42 /* GigasecondExample.m */; };
51
53
  E907D0CC1D6B734800106C42 /* GigasecondTest.m in Sources */ = {isa = PBXBuildFile; fileRef = E907D0CB1D6B734800106C42 /* GigasecondTest.m */; };
52
54
  E907FE921D87547D00B93DA9 /* ScrabbleScoreExample.m in Sources */ = {isa = PBXBuildFile; fileRef = E907FE911D87547D00B93DA9 /* ScrabbleScoreExample.m */; };
@@ -129,6 +131,9 @@
129
131
  1EFACAA01CCCAF3D006F2E69 /* WordCountExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WordCountExample.h; path = "../../exercises/word-count/WordCountExample.h"; sourceTree = "<group>"; };
130
132
  1EFACAA11CCCAF3D006F2E69 /* WordCountExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WordCountExample.m; path = "../../exercises/word-count/WordCountExample.m"; sourceTree = "<group>"; };
131
133
  1EFACAA21CCCAF3D006F2E69 /* WordCountTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WordCountTest.m; path = "../../exercises/word-count/WordCountTest.m"; sourceTree = "<group>"; };
134
+ A065F5751E3098080048E337 /* BeerSongExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BeerSongExample.h; path = "../../exercises/beer-song/BeerSongExample.h"; sourceTree = "<group>"; };
135
+ A065F5761E3098080048E337 /* BeerSongExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BeerSongExample.m; path = "../../exercises/beer-song/BeerSongExample.m"; sourceTree = "<group>"; };
136
+ A065F5771E3098080048E337 /* BeerSongTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BeerSongTest.m; path = "../../exercises/beer-song/BeerSongTest.m"; sourceTree = "<group>"; };
132
137
  E907D0C81D6B731600106C42 /* GigasecondExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GigasecondExample.h; path = ../../exercises/gigasecond/GigasecondExample.h; sourceTree = "<group>"; };
133
138
  E907D0C91D6B731600106C42 /* GigasecondExample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GigasecondExample.m; path = ../../exercises/gigasecond/GigasecondExample.m; sourceTree = "<group>"; };
134
139
  E907D0CB1D6B734800106C42 /* GigasecondTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GigasecondTest.m; path = ../../exercises/gigasecond/GigasecondTest.m; sourceTree = "<group>"; };
@@ -207,6 +212,7 @@
207
212
  E9E8B6EA1D519DE10012F12C /* AllYourBase */,
208
213
  E9E8B6EB1D519DE70012F12C /* Anagram */,
209
214
  E9386EEB1E0B68F90009A414 /* AtbashCipher */,
215
+ A0CE03811E2F994200669F42 /* BeerSong */,
210
216
  E9E8B6EC1D519DEF0012F12C /* Bob */,
211
217
  E9381D4F1D8F2DA4003F22A1 /* Clock */,
212
218
  E9381D431D8EDFB8003F22A1 /* DifferenceOfSquares */,
@@ -255,6 +261,16 @@
255
261
  name = Products;
256
262
  sourceTree = "<group>";
257
263
  };
264
+ A0CE03811E2F994200669F42 /* BeerSong */ = {
265
+ isa = PBXGroup;
266
+ children = (
267
+ A065F5751E3098080048E337 /* BeerSongExample.h */,
268
+ A065F5761E3098080048E337 /* BeerSongExample.m */,
269
+ A065F5771E3098080048E337 /* BeerSongTest.m */,
270
+ );
271
+ name = BeerSong;
272
+ sourceTree = "<group>";
273
+ };
258
274
  E907D0C71D6B72B600106C42 /* Gigasecond */ = {
259
275
  isa = PBXGroup;
260
276
  children = (
@@ -601,7 +617,7 @@
601
617
  1EE9CC521CB462CB00C92E6D /* Project object */ = {
602
618
  isa = PBXProject;
603
619
  attributes = {
604
- LastUpgradeCheck = 0730;
620
+ LastUpgradeCheck = 0810;
605
621
  ORGANIZATIONNAME = exercism;
606
622
  TargetAttributes = {
607
623
  1E1068C41D408EE30019B25B = {
@@ -675,8 +691,10 @@
675
691
  E907FE941D87554500B93DA9 /* ScrabbleScoreTest.m in Sources */,
676
692
  1EFACAB51CCCAF3D006F2E69 /* PhoneNumberExample.m in Sources */,
677
693
  E951B6B91D429550009EB5B6 /* AllergiesTest.m in Sources */,
694
+ A065F5791E3098080048E337 /* BeerSongTest.m in Sources */,
678
695
  E9381D461D8EDFFA003F22A1 /* DifferenceOfSquaresExample.m in Sources */,
679
696
  E9A7B2F71DA5AC37009056B6 /* LargestSeriesProductExample.m in Sources */,
697
+ A065F5781E3098080048E337 /* BeerSongExample.m in Sources */,
680
698
  E907D0CA1D6B731600106C42 /* GigasecondExample.m in Sources */,
681
699
  E9381D521D8F2DCC003F22A1 /* ClockExample.m in Sources */,
682
700
  E99D1D811D5533BF0006A303 /* SumOfMultiplesExample.m in Sources */,
@@ -781,8 +799,10 @@
781
799
  CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
782
800
  CLANG_WARN_EMPTY_BODY = YES;
783
801
  CLANG_WARN_ENUM_CONVERSION = YES;
802
+ CLANG_WARN_INFINITE_RECURSION = YES;
784
803
  CLANG_WARN_INT_CONVERSION = YES;
785
804
  CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
805
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
786
806
  CLANG_WARN_UNREACHABLE_CODE = YES;
787
807
  CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
788
808
  CODE_SIGN_IDENTITY = "";
@@ -825,8 +845,10 @@
825
845
  CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
826
846
  CLANG_WARN_EMPTY_BODY = YES;
827
847
  CLANG_WARN_ENUM_CONVERSION = YES;
848
+ CLANG_WARN_INFINITE_RECURSION = YES;
828
849
  CLANG_WARN_INT_CONVERSION = YES;
829
850
  CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
851
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
830
852
  CLANG_WARN_UNREACHABLE_CODE = YES;
831
853
  CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
832
854
  CODE_SIGN_IDENTITY = "";
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <Scheme
3
- LastUpgradeVersion = "0730"
3
+ LastUpgradeVersion = "0810"
4
4
  version = "1.3">
5
5
  <BuildAction
6
6
  parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <Scheme
3
- LastUpgradeVersion = "0730"
3
+ LastUpgradeVersion = "0810"
4
4
  version = "1.3">
5
5
  <BuildAction
6
6
  parallelizeBuildables = "YES"
@@ -56,6 +56,11 @@
56
56
  "slug": "anagram",
57
57
  "topics": []
58
58
  },
59
+ {
60
+ "difficulty": 1,
61
+ "slug": "grade-school",
62
+ "topics": []
63
+ },
59
64
  {
60
65
  "difficulty": 1,
61
66
  "slug": "robot-name",
@@ -0,0 +1,17 @@
1
+ use v6;
2
+
3
+ unit class GradeSchool::Roster is export;
4
+ has %!roster;
5
+
6
+ method add-student (Str:D :$name!, Int:D :$grade!) {
7
+ %!roster.append($grade, $name);
8
+ }
9
+
10
+ method list-grade (Int:D $grade --> Seq:D) {
11
+ %!roster{$grade}.sort;
12
+ }
13
+
14
+ method list-all {
15
+ my @list.append("Grade $_", %!roster{$_}.sort) for %!roster.keys.sort;
16
+ return @list;
17
+ }
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env perl6
2
+ use v6;
3
+ use Test;
4
+ use lib IO::Path.new($?FILE).parent.path;
5
+
6
+ plan 10;
7
+ my $module = %*ENV<EXERCISM> ?? 'Example' !! 'GradeSchool';
8
+ use-ok $module;
9
+ require ::($module) <Roster>;
10
+
11
+ subtest 'Can use all methods', {
12
+ plan 3;
13
+ ok Roster.can($_), $_ for <add-student list-grade list-all>;
14
+ } or fail 'Missing method(s)';
15
+
16
+ my $roster = Roster.new;
17
+
18
+ ok $roster.add-student(:name('Jim'), :2grade), 'Add Jim to grade 2';
19
+ is $roster.list-grade(2), <Jim>, 'List grade 2';
20
+ ok $roster.add-student(:name('Zoe'), :2grade), 'Add Zoe to grade 2';
21
+ ok $roster.add-student(:name('Barb'), :1grade), 'Add Barb to grade 1';
22
+ is $roster.list-grade(2), <Jim Zoe>, 'List grade 2';
23
+ is $roster.list-grade(1), <Barb>, 'List grade 1';
24
+
25
+ subtest 'Additional students', {
26
+ plan 6;
27
+ ok $roster.add-student(:name($_), :1grade), "Add $_ to grade 1" for <Charlie Anna>;
28
+ ok $roster.add-student(:name('Alex'), :2grade), 'Add Alex to grade 2';
29
+ ok $roster.add-student(:name($_), :3grade), "Add $_ to grade 3" for <Tom Dick Harry>;
30
+ }
31
+
32
+ is $roster.list-all, ('Grade 1', <Anna Barb Charlie>, 'Grade 2', <Alex Jim Zoe>, 'Grade 3', <Dick Harry Tom>), 'List all';
@@ -149,12 +149,18 @@
149
149
  "slug": "sublist",
150
150
  "difficulty": 1,
151
151
  "topics": [
152
+ "Generics",
153
+ "Enumerations",
154
+ "Lists"
152
155
  ]
153
156
  },
154
157
  {
155
158
  "slug": "rna-transcription",
156
159
  "difficulty": 1,
157
160
  "topics": [
161
+ "Optional values",
162
+ "Strings",
163
+ "Transforming"
158
164
  ]
159
165
  },
160
166
  {
@@ -1,3 +1,3 @@
1
- scalaVersion := "2.11.7"
1
+ scalaVersion := "2.12.1"
2
2
 
3
- libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.5" % "test"
3
+ libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
@@ -1,3 +1,3 @@
1
- scalaVersion := "2.11.7"
1
+ scalaVersion := "2.12.1"
2
2
 
3
- libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.5" % "test"
3
+ libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
@@ -1,6 +1,6 @@
1
1
  import org.scalatest.{FunSuite, Matchers}
2
2
 
3
- class SublistSpecs extends FunSuite with Matchers {
3
+ class SublistTest extends FunSuite with Matchers {
4
4
  test("empty lists") {
5
5
  Sublist.sublist(List(), List()) should be (Sublist.Equal)
6
6
  }
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.0.6.14
4
+ version: 2.0.6.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -735,6 +735,7 @@ files:
735
735
  - tracks/ceylon/.travis.yml
736
736
  - tracks/ceylon/LICENSE
737
737
  - tracks/ceylon/README.md
738
+ - tracks/ceylon/bin/compile-all-stubs
738
739
  - tracks/ceylon/bin/fetch-configlet
739
740
  - tracks/ceylon/bin/test-all-exercises
740
741
  - tracks/ceylon/bin/test-exercise
@@ -762,6 +763,11 @@ files:
762
763
  - tracks/ceylon/exercises/leap/source/leap/Leap.ceylon
763
764
  - tracks/ceylon/exercises/leap/source/leap/LeapTest.ceylon
764
765
  - tracks/ceylon/exercises/leap/source/leap/module.ceylon
766
+ - tracks/ceylon/exercises/react/example/Reactor.ceylon
767
+ - tracks/ceylon/exercises/react/example/module.ceylon
768
+ - tracks/ceylon/exercises/react/source/react/Reactor.ceylon
769
+ - tracks/ceylon/exercises/react/source/react/ReactorTest.ceylon
770
+ - tracks/ceylon/exercises/react/source/react/module.ceylon
765
771
  - tracks/ceylon/exercises/sieve/example/Sieve.ceylon
766
772
  - tracks/ceylon/exercises/sieve/example/module.ceylon
767
773
  - tracks/ceylon/exercises/sieve/source/sieve/Sieve.ceylon
@@ -1528,6 +1534,8 @@ files:
1528
1534
  - tracks/csharp/exercises/wordy/WordyTest.cs
1529
1535
  - tracks/csharp/exercises/zebra-puzzle/Example.cs
1530
1536
  - tracks/csharp/exercises/zebra-puzzle/ZebraPuzzleTest.cs
1537
+ - tracks/csharp/exercises/zipper/Example.cs
1538
+ - tracks/csharp/exercises/zipper/ZipperTest.cs
1531
1539
  - tracks/csharp/img/icon.png
1532
1540
  - tracks/csharp/paket.dependencies
1533
1541
  - tracks/csharp/paket.lock
@@ -2911,6 +2919,10 @@ files:
2911
2919
  - tracks/go/exercises/sum-of-multiples/sum_of_multiples_test.go
2912
2920
  - tracks/go/exercises/tournament/example.go
2913
2921
  - tracks/go/exercises/tournament/tournament_test.go
2922
+ - tracks/go/exercises/transpose/cases_test.go
2923
+ - tracks/go/exercises/transpose/example.go
2924
+ - tracks/go/exercises/transpose/example_gen.go
2925
+ - tracks/go/exercises/transpose/transpose_test.go
2914
2926
  - tracks/go/exercises/tree-building/example.go
2915
2927
  - tracks/go/exercises/tree-building/tree_building.go
2916
2928
  - tracks/go/exercises/tree-building/tree_test.go
@@ -4822,6 +4834,9 @@ files:
4822
4834
  - tracks/objective-c/exercises/atbash-cipher/AtbashCipherExample.h
4823
4835
  - tracks/objective-c/exercises/atbash-cipher/AtbashCipherExample.m
4824
4836
  - tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
4837
+ - tracks/objective-c/exercises/beer-song/BeerSongExample.h
4838
+ - tracks/objective-c/exercises/beer-song/BeerSongExample.m
4839
+ - tracks/objective-c/exercises/beer-song/BeerSongTest.m
4825
4840
  - tracks/objective-c/exercises/bob/BobExample.h
4826
4841
  - tracks/objective-c/exercises/bob/BobExample.m
4827
4842
  - tracks/objective-c/exercises/bob/BobTest.m
@@ -5395,6 +5410,8 @@ files:
5395
5410
  - tracks/perl6/exercises/binary/binary.t
5396
5411
  - tracks/perl6/exercises/bob/Example.pm
5397
5412
  - tracks/perl6/exercises/bob/bob.t
5413
+ - tracks/perl6/exercises/grade-school/Example.pm
5414
+ - tracks/perl6/exercises/grade-school/grade-school.t
5398
5415
  - tracks/perl6/exercises/grains/Example.pm
5399
5416
  - tracks/perl6/exercises/grains/grains.t
5400
5417
  - tracks/perl6/exercises/leap/Example.pm