trackler 2.2.1.111 → 2.2.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/README.md +6 -2
- data/problem-specifications/exercises/go-counting/canonical-data.json +200 -0
- data/problem-specifications/exercises/go-counting/description.md +2 -0
- data/tracks/c/config.json +24 -0
- data/tracks/c/exercises/minesweeper/README.md +26 -0
- data/tracks/c/exercises/minesweeper/makefile +25 -0
- data/tracks/c/exercises/minesweeper/src/example.c +64 -0
- data/tracks/c/exercises/minesweeper/src/example.h +7 -0
- data/tracks/c/exercises/minesweeper/test/test_minesweeper.c +261 -0
- data/tracks/c/exercises/minesweeper/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/minesweeper/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/minesweeper/test/vendor/unity_internals.h +701 -0
- data/tracks/c/exercises/run-length-encoding/README.md +23 -0
- data/tracks/c/exercises/run-length-encoding/makefile +27 -0
- data/tracks/c/exercises/run-length-encoding/src/example.c +126 -0
- data/tracks/c/exercises/run-length-encoding/src/example.h +7 -0
- data/tracks/c/exercises/run-length-encoding/test/test_run_length_encoding.c +139 -0
- data/tracks/c/exercises/run-length-encoding/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/run-length-encoding/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/run-length-encoding/test/vendor/unity_internals.h +701 -0
- data/tracks/delphi/exercises/clock/uClockTest.pas +6 -6
- data/tracks/ecmascript/config.json +11 -0
- data/tracks/ecmascript/exercises/armstrong-numbers/README.md +48 -0
- data/tracks/ecmascript/exercises/armstrong-numbers/armstrong-numbers.spec.js +43 -0
- data/tracks/ecmascript/exercises/armstrong-numbers/example.js +11 -0
- data/tracks/ecmascript/exercises/armstrong-numbers/package.json +70 -0
- data/tracks/javascript/config.json +11 -0
- data/tracks/javascript/exercises/armstrong-numbers/README.md +46 -0
- data/tracks/javascript/exercises/armstrong-numbers/armstrong-numbers.spec.js +43 -0
- data/tracks/javascript/exercises/armstrong-numbers/example.js +11 -0
- data/tracks/objective-c/config.json +12 -0
- data/tracks/objective-c/exercises/series/README.md +50 -0
- data/tracks/objective-c/exercises/series/SeriesExample.h +12 -0
- data/tracks/objective-c/exercises/series/SeriesExample.m +50 -0
- data/tracks/objective-c/exercises/series/SeriesTest.m +97 -0
- data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +18 -0
- data/tracks/rust/exercises/gigasecond/.meta/hints.md +1 -0
- data/tracks/rust/exercises/gigasecond/README.md +3 -0
- data/tracks/rust/exercises/gigasecond/example.rs +1 -1
- data/tracks/rust/exercises/gigasecond/src/lib.rs +7 -7
- data/tracks/rust/exercises/gigasecond/tests/gigasecond.rs +1 -1
- data/tracks/rust/exercises/prime-factors/src/lib.rs +3 -0
- data/tracks/scala/exercises/saddle-points/src/test/scala/SaddlePointsTest.scala +1 -1
- data/tracks/scala/exercises/say/src/test/scala/SayTest.scala +18 -19
- data/tracks/scala/exercises/scrabble-score/src/test/scala/ScrabbleScoreTest.scala +13 -13
- data/tracks/scala/testgen/src/main/scala/SaddlePointsTestGenerator.scala +3 -3
- data/tracks/scala/testgen/src/main/scala/SayTestGenerator.scala +6 -6
- data/tracks/scala/testgen/src/main/scala/ScrabbleScoreTestGenerator.scala +2 -2
- data/tracks/typescript/config.json +16 -0
- data/tracks/typescript/exercises/simple-cipher/README.md +114 -0
- data/tracks/typescript/exercises/simple-cipher/package.json +36 -0
- data/tracks/typescript/exercises/simple-cipher/simple-cipher.example.ts +42 -0
- data/tracks/typescript/exercises/simple-cipher/simple-cipher.test.ts +84 -0
- data/tracks/typescript/exercises/simple-cipher/simple-cipher.ts +11 -0
- data/tracks/typescript/exercises/simple-cipher/tsconfig.json +22 -0
- data/tracks/typescript/exercises/simple-cipher/tslint.json +127 -0
- data/tracks/typescript/exercises/simple-cipher/yarn.lock +2624 -0
- metadata +39 -2
@@ -46,15 +46,15 @@ type
|
|
46
46
|
|
47
47
|
[Test]
|
48
48
|
[Ignore]
|
49
|
-
procedure
|
49
|
+
procedure Hour_and_minutes_roll_over;
|
50
50
|
|
51
51
|
[Test]
|
52
52
|
[Ignore]
|
53
|
-
procedure
|
53
|
+
procedure Hour_and_minutes_roll_over_continuously;
|
54
54
|
|
55
55
|
[Test]
|
56
56
|
[Ignore]
|
57
|
-
procedure
|
57
|
+
procedure Hour_and_minutes_roll_over_to_exactly_midnight;
|
58
58
|
|
59
59
|
[Test]
|
60
60
|
[Ignore]
|
@@ -269,17 +269,17 @@ begin
|
|
269
269
|
Assert.AreEqual('04:43', Clock.SetHands(0, 1723).ToString);
|
270
270
|
end;
|
271
271
|
|
272
|
-
procedure TClockTest.
|
272
|
+
procedure TClockTest.Hour_and_minutes_roll_over;
|
273
273
|
begin
|
274
274
|
Assert.AreEqual('03:40', Clock.SetHands(25, 160).ToString);
|
275
275
|
end;
|
276
276
|
|
277
|
-
procedure TClockTest.
|
277
|
+
procedure TClockTest.Hour_and_minutes_roll_over_continuously;
|
278
278
|
begin
|
279
279
|
Assert.AreEqual('11:01', Clock.SetHands(201, 3001).ToString);
|
280
280
|
end;
|
281
281
|
|
282
|
-
procedure TClockTest.
|
282
|
+
procedure TClockTest.Hour_and_minutes_roll_over_to_exactly_midnight;
|
283
283
|
begin
|
284
284
|
Assert.AreEqual('00:00', Clock.SetHands(72, 8640).ToString);
|
285
285
|
end;
|
@@ -1264,6 +1264,17 @@
|
|
1264
1264
|
"Arrays",
|
1265
1265
|
"Text formatting"
|
1266
1266
|
]
|
1267
|
+
},
|
1268
|
+
{
|
1269
|
+
"uuid": "b28c34f4-f7af-47db-95c6-f920e020bbba",
|
1270
|
+
"slug": "armstrong-numbers",
|
1271
|
+
"core": false,
|
1272
|
+
"unlocked_by": null,
|
1273
|
+
"difficulty": 2,
|
1274
|
+
"topics": [
|
1275
|
+
"mathematics",
|
1276
|
+
"algorithms"
|
1277
|
+
]
|
1267
1278
|
}
|
1268
1279
|
],
|
1269
1280
|
"foregone": []
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Armstrong Numbers
|
2
|
+
|
3
|
+
An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a number that is the sum of its own digits each raised to the power of the number of digits.
|
4
|
+
|
5
|
+
For example:
|
6
|
+
|
7
|
+
- 9 is an Armstrong number, because `9 = 9^1 = 9`
|
8
|
+
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 2`
|
9
|
+
- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153`
|
10
|
+
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`
|
11
|
+
|
12
|
+
Write some code to determine whether a number is an Armstrong number.
|
13
|
+
|
14
|
+
## Setup
|
15
|
+
|
16
|
+
Go through the setup instructions for ECMAScript to
|
17
|
+
install the necessary dependencies:
|
18
|
+
|
19
|
+
http://exercism.io/languages/ecmascript
|
20
|
+
|
21
|
+
## Requirements
|
22
|
+
|
23
|
+
Install assignment dependencies:
|
24
|
+
|
25
|
+
```bash
|
26
|
+
$ npm install
|
27
|
+
```
|
28
|
+
|
29
|
+
## Making the test suite pass
|
30
|
+
|
31
|
+
Execute the tests with:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
$ npm test
|
35
|
+
```
|
36
|
+
|
37
|
+
In the test suites all tests but the first have been skipped.
|
38
|
+
|
39
|
+
Once you get a test passing, you can enable the next one by
|
40
|
+
changing `xtest` to `test`.
|
41
|
+
|
42
|
+
## Source
|
43
|
+
|
44
|
+
Wikipedia [Narcissistic number](https://en.wikipedia.org/wiki/Narcissistic_number)
|
45
|
+
|
46
|
+
## Submitting Incomplete Solutions
|
47
|
+
|
48
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import ArmstrongNumber from './armstrong-numbers';
|
2
|
+
|
3
|
+
describe('ArmstrongNumber', () => {
|
4
|
+
test('Single digit numbers are Armstrong numbers', () => {
|
5
|
+
const input = 5;
|
6
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
7
|
+
});
|
8
|
+
|
9
|
+
xtest('There are no 2 digit Armstrong numbers', () => {
|
10
|
+
const input = 10;
|
11
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
12
|
+
});
|
13
|
+
|
14
|
+
xtest('Three digit number that is an Armstrong number', () => {
|
15
|
+
const input = 153;
|
16
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
17
|
+
});
|
18
|
+
|
19
|
+
xtest('Three digit number that is not an Armstrong number', () => {
|
20
|
+
const input = 100;
|
21
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
22
|
+
});
|
23
|
+
|
24
|
+
xtest('Four digit number that is an Armstrong number', () => {
|
25
|
+
const input = 9474;
|
26
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
27
|
+
});
|
28
|
+
|
29
|
+
xtest('Four digit number that is not an Armstrong number', () => {
|
30
|
+
const input = 9475;
|
31
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
32
|
+
});
|
33
|
+
|
34
|
+
xtest('Seven digit number that is an Armstrong number', () => {
|
35
|
+
const input = 9926315;
|
36
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
37
|
+
});
|
38
|
+
|
39
|
+
xtest('Seven digit number that is not an Armstrong number', () => {
|
40
|
+
const input = 9926314;
|
41
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
42
|
+
});
|
43
|
+
});
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"name": "xecmascript",
|
3
|
+
"version": "0.0.0",
|
4
|
+
"description": "Exercism exercises in ECMAScript 6.",
|
5
|
+
"author": "Katrina Owen",
|
6
|
+
"private": true,
|
7
|
+
"repository": {
|
8
|
+
"type": "git",
|
9
|
+
"url": "https://github.com/exercism/xecmascript"
|
10
|
+
},
|
11
|
+
"devDependencies": {
|
12
|
+
"babel-jest": "^21.2.0",
|
13
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
|
+
"babel-preset-env": "^1.4.0",
|
15
|
+
"eslint": "^3.19.0",
|
16
|
+
"eslint-config-airbnb": "^15.0.1",
|
17
|
+
"eslint-plugin-import": "^2.2.0",
|
18
|
+
"eslint-plugin-jsx-a11y": "^5.0.1",
|
19
|
+
"eslint-plugin-react": "^7.0.1",
|
20
|
+
"jest": "^21.2.1"
|
21
|
+
},
|
22
|
+
"jest": {
|
23
|
+
"modulePathIgnorePatterns": [
|
24
|
+
"package.json"
|
25
|
+
]
|
26
|
+
},
|
27
|
+
"babel": {
|
28
|
+
"presets": [["env",{"node": "current"}]
|
29
|
+
],
|
30
|
+
"plugins": [
|
31
|
+
[
|
32
|
+
"babel-plugin-transform-builtin-extend",
|
33
|
+
{
|
34
|
+
"globals": [
|
35
|
+
"Error"
|
36
|
+
]
|
37
|
+
}
|
38
|
+
],
|
39
|
+
[
|
40
|
+
"transform-regenerator"
|
41
|
+
]
|
42
|
+
]
|
43
|
+
},
|
44
|
+
"scripts": {
|
45
|
+
"test": "jest --no-cache ./*",
|
46
|
+
"watch": "jest --no-cache --watch ./*",
|
47
|
+
"lint": "eslint .",
|
48
|
+
"lint-test": "eslint . && jest --no-cache ./* "
|
49
|
+
},
|
50
|
+
"eslintConfig": {
|
51
|
+
"parserOptions": {
|
52
|
+
"ecmaVersion": 6,
|
53
|
+
"sourceType": "module"
|
54
|
+
},
|
55
|
+
"env": {
|
56
|
+
"es6": true,
|
57
|
+
"node": true,
|
58
|
+
"jest": true
|
59
|
+
},
|
60
|
+
"extends": "airbnb",
|
61
|
+
"rules": {
|
62
|
+
"import/no-unresolved": "off",
|
63
|
+
"import/extensions": "off"
|
64
|
+
}
|
65
|
+
},
|
66
|
+
"licenses": [
|
67
|
+
"MIT"
|
68
|
+
],
|
69
|
+
"dependencies": {}
|
70
|
+
}
|
@@ -1243,6 +1243,17 @@
|
|
1243
1243
|
"searching",
|
1244
1244
|
"pattern_recognition"
|
1245
1245
|
]
|
1246
|
+
},
|
1247
|
+
{
|
1248
|
+
"uuid": "0e4b628c-870d-446b-a400-3cc72457f2bc",
|
1249
|
+
"slug": "armstrong-numbers",
|
1250
|
+
"core": false,
|
1251
|
+
"unlocked_by": null,
|
1252
|
+
"difficulty": 2,
|
1253
|
+
"topics": [
|
1254
|
+
"mathematics",
|
1255
|
+
"algorithms"
|
1256
|
+
]
|
1246
1257
|
}
|
1247
1258
|
],
|
1248
1259
|
"foregone": [],
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Armstrong Numbers
|
2
|
+
|
3
|
+
An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a number that is the sum of its own digits each raised to the power of the number of digits.
|
4
|
+
|
5
|
+
For example:
|
6
|
+
|
7
|
+
- 9 is an Armstrong number, because `9 = 9^1 = 9`
|
8
|
+
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 2`
|
9
|
+
- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153`
|
10
|
+
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`
|
11
|
+
|
12
|
+
Write some code to determine whether a number is an Armstrong number.
|
13
|
+
|
14
|
+
## Setup
|
15
|
+
|
16
|
+
Go through the setup instructions for JavaScript to install the
|
17
|
+
necessary dependencies:
|
18
|
+
|
19
|
+
http://exercism.io/languages/javascript/installation
|
20
|
+
|
21
|
+
## Running the test suite
|
22
|
+
|
23
|
+
The provided test suite uses [Jasmine](https://jasmine.github.io/).
|
24
|
+
You can install it by opening a terminal window and running the
|
25
|
+
following command:
|
26
|
+
|
27
|
+
```sh
|
28
|
+
npm install -g jasmine
|
29
|
+
```
|
30
|
+
|
31
|
+
Run the test suite from the exercise directory with:
|
32
|
+
|
33
|
+
```sh
|
34
|
+
jasmine armstrong-numbers.spec.js
|
35
|
+
```
|
36
|
+
|
37
|
+
In many test suites all but the first test have been marked "pending".
|
38
|
+
Once you get a test passing, activate the next one by changing `xit` to `it`.
|
39
|
+
|
40
|
+
## Source
|
41
|
+
|
42
|
+
Wikipedia [Narcissistic number](https://en.wikipedia.org/wiki/Narcissistic_number)
|
43
|
+
|
44
|
+
## Submitting Incomplete Solutions
|
45
|
+
|
46
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
var ArmstrongNumber = require('./armstrong-numbers');
|
2
|
+
|
3
|
+
describe('ArmstrongNumber', function () {
|
4
|
+
it('Single digit numbers are Armstrong numbers', function () {
|
5
|
+
var input = 5;
|
6
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
7
|
+
});
|
8
|
+
|
9
|
+
xit('There are no 2 digit Armstrong numbers', function () {
|
10
|
+
var input = 10;
|
11
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
12
|
+
});
|
13
|
+
|
14
|
+
xit('Three digit number that is an Armstrong number', function () {
|
15
|
+
var input = 153;
|
16
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
17
|
+
});
|
18
|
+
|
19
|
+
xit('Three digit number that is not an Armstrong number', function () {
|
20
|
+
var input = 100;
|
21
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
22
|
+
});
|
23
|
+
|
24
|
+
xit('Four digit number that is an Armstrong number', function () {
|
25
|
+
var input = 9474;
|
26
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
27
|
+
});
|
28
|
+
|
29
|
+
xit('Four digit number that is not an Armstrong number', function () {
|
30
|
+
var input = 9475;
|
31
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
32
|
+
});
|
33
|
+
|
34
|
+
xit('Seven digit number that is an Armstrong number', function () {
|
35
|
+
var input = 9926315;
|
36
|
+
expect(ArmstrongNumber.validate(input)).toBe(true);
|
37
|
+
});
|
38
|
+
|
39
|
+
xit('Seven digit number that is not an Armstrong number', function () {
|
40
|
+
var input = 9926314;
|
41
|
+
expect(ArmstrongNumber.validate(input)).toBe(false);
|
42
|
+
});
|
43
|
+
});
|
@@ -296,6 +296,18 @@
|
|
296
296
|
"unlocked_by": null,
|
297
297
|
"uuid": "d7d66773-e07f-4da1-932b-9431437d34d6"
|
298
298
|
},
|
299
|
+
{
|
300
|
+
"core": false,
|
301
|
+
"difficulty": 3,
|
302
|
+
"slug": "series",
|
303
|
+
"topics": [
|
304
|
+
"lists",
|
305
|
+
"looping",
|
306
|
+
"integers"
|
307
|
+
],
|
308
|
+
"unlocked_by": null,
|
309
|
+
"uuid": "a56e3c85-715e-4730-966f-cc46616aaa95"
|
310
|
+
},
|
299
311
|
{
|
300
312
|
"core": false,
|
301
313
|
"difficulty": 4,
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Series
|
2
|
+
|
3
|
+
Given a string of digits, output all the contiguous substrings of length `n` in
|
4
|
+
that string.
|
5
|
+
|
6
|
+
For example, the string "49142" has the following 3-digit series:
|
7
|
+
|
8
|
+
- 491
|
9
|
+
- 914
|
10
|
+
- 142
|
11
|
+
|
12
|
+
And the following 4-digit series:
|
13
|
+
|
14
|
+
- 4914
|
15
|
+
- 9142
|
16
|
+
|
17
|
+
And if you ask for a 6-digit series from a 5-digit string, you deserve
|
18
|
+
whatever you get.
|
19
|
+
|
20
|
+
Note that these series are only required to occupy *adjacent positions*
|
21
|
+
in the input; the digits need not be *numerically consecutive*.
|
22
|
+
|
23
|
+
## Setup
|
24
|
+
|
25
|
+
There are two different methods of getting set up to run the tests with Objective-C:
|
26
|
+
|
27
|
+
- Create an Xcode project with a test target which will run the tests.
|
28
|
+
- Use the ruby gem `objc` as a test runner utility.
|
29
|
+
|
30
|
+
Both are described in more detail here: http://exercism.io/languages/objective-c
|
31
|
+
|
32
|
+
### Submitting Exercises
|
33
|
+
|
34
|
+
When submitting an exercise, make sure your solution file is in the same directory as the test code.
|
35
|
+
|
36
|
+
The submit command will look something like:
|
37
|
+
|
38
|
+
```shell
|
39
|
+
exercism submit <path-to-exercism-workspace>/objective-c/sieve/Sieve.m
|
40
|
+
```
|
41
|
+
|
42
|
+
You can find the Exercism workspace by running `exercism debug` and looking for the line beginning
|
43
|
+
with Workspace.
|
44
|
+
|
45
|
+
## Source
|
46
|
+
|
47
|
+
A subset of the Problem 8 at Project Euler [http://projecteuler.net/problem=8](http://projecteuler.net/problem=8)
|
48
|
+
|
49
|
+
## Submitting Incomplete Solutions
|
50
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
@interface Series : NSObject
|
4
|
+
|
5
|
+
NS_ASSUME_NONNULL_BEGIN
|
6
|
+
|
7
|
+
- (instancetype)initWithNumberString:(NSString *)numberString;
|
8
|
+
- (nullable NSArray<NSArray<NSNumber *> *> *)slicesWithSize:(NSInteger)size;
|
9
|
+
|
10
|
+
NS_ASSUME_NONNULL_END
|
11
|
+
|
12
|
+
@end
|