trackler 2.1.0.41 → 2.1.0.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fixtures/tracks/fake/docs/STRAY.md +1 -0
- data/lib/trackler/doc_file.rb +88 -0
- data/lib/trackler/track.rb +6 -40
- data/lib/trackler/version.rb +1 -1
- data/tracks/bash/README.md +2 -2
- data/tracks/bash/config.json +1 -1
- data/tracks/c/README.md +1 -1
- data/tracks/c/config.json +1 -1
- data/tracks/ceylon/README.md +4 -4
- data/tracks/ceylon/config.json +1 -1
- data/tracks/clojure/README.org +3 -3
- data/tracks/clojure/config.json +1 -1
- data/tracks/cpp/README.md +2 -2
- data/tracks/cpp/config.json +1 -1
- data/tracks/cpp/docs/INSTALLATION.md +2 -2
- data/tracks/crystal/config.json +1 -1
- data/tracks/csharp/config.json +1 -1
- data/tracks/delphi/README.md +2 -2
- data/tracks/delphi/config.json +1 -1
- data/tracks/delphi/exercises/bowling/uBowlingTests.pas +14 -14
- data/tracks/ecmascript/config.json +1 -1
- data/tracks/elisp/README.org +4 -4
- data/tracks/elisp/config.json +1 -1
- data/tracks/elixir/README.md +3 -3
- data/tracks/elixir/config.json +1 -1
- data/tracks/erlang/README.md +2 -2
- data/tracks/erlang/config.json +2 -2
- data/tracks/factor/README.md +9 -9
- data/tracks/factor/config.json +1 -1
- data/tracks/fsharp/config.json +1 -1
- data/tracks/go/README.md +16 -16
- data/tracks/go/config.json +1 -1
- data/tracks/go/exercises/gigasecond/gigasecond_test.go +2 -2
- data/tracks/go/gen/gen.go +2 -2
- data/tracks/haskell/.gitignore +1 -1
- data/tracks/haskell/README.md +12 -8
- data/tracks/haskell/config.json +1 -1
- data/tracks/haskell/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/idris/README.md +1 -1
- data/tracks/idris/config.json +1 -1
- data/tracks/java/POLICIES.md +7 -7
- data/tracks/java/README.md +7 -7
- data/tracks/java/bin/journey-test.sh +1 -1
- data/tracks/java/config.json +1 -1
- data/tracks/java/docs/MAINTAINING.md +3 -20
- data/tracks/java/docs/TESTS.md +3 -3
- data/tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java +23 -20
- data/tracks/java/exercises/hello-world/GETTING_STARTED.md +1 -1
- data/tracks/java/exercises/hello-world/TUTORIAL.md +2 -2
- data/tracks/javascript/config.json +1 -1
- data/tracks/julia/.travis.yml +0 -2
- data/tracks/julia/config.json +9 -0
- data/tracks/julia/exercises/custom-set/example.jl +1 -1
- data/tracks/julia/exercises/luhn/example.jl +1 -1
- data/tracks/julia/exercises/robot-name/HINTS.md +17 -0
- data/tracks/julia/exercises/robot-name/example.jl +14 -0
- data/tracks/julia/exercises/robot-name/robot-name.jl +8 -0
- data/tracks/julia/exercises/robot-name/runtests.jl +69 -0
- data/tracks/kotlin/README.md +7 -7
- data/tracks/kotlin/config.json +1 -1
- data/tracks/kotlin/docs/TESTS.md +3 -3
- data/tracks/kotlin/exercises/hello-world/GETTING_STARTED.md +1 -1
- data/tracks/kotlin/exercises/hello-world/TUTORIAL.md +1 -1
- data/tracks/lfe/README.md +2 -2
- data/tracks/lfe/config.json +1 -1
- data/tracks/lisp/README.md +1 -1
- data/tracks/lisp/config.json +2 -2
- data/tracks/lua/README.md +9 -9
- data/tracks/lua/config.json +1 -1
- data/tracks/lua/exercises/hamming/hamming_spec.lua +15 -7
- data/tracks/lua/exercises/raindrops/raindrops_spec.lua +46 -14
- data/tracks/mips/config.json +1 -1
- data/tracks/objective-c/Dangerfile +1 -1
- data/tracks/objective-c/README.md +1 -1
- data/tracks/objective-c/config.json +1 -1
- data/tracks/ocaml/README.md +2 -2
- data/tracks/ocaml/config.json +1 -1
- data/tracks/ocaml/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/ocaml/tools/test-generator/README.md +2 -2
- data/tracks/perl5/README.md +1 -1
- data/tracks/perl5/config.json +1 -1
- data/tracks/perl6/README.md +2 -2
- data/tracks/perl6/config.json +1 -1
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +43 -32
- data/tracks/perl6/exercises/all-your-base/example.yaml +19 -9
- data/tracks/php/config.json +1 -1
- data/tracks/pony/README.md +2 -2
- data/tracks/pony/config.json +1 -1
- data/tracks/powershell/README.md +1 -1
- data/tracks/powershell/config.json +1 -1
- data/tracks/purescript/README.md +5 -5
- data/tracks/purescript/config.json +1 -1
- data/tracks/r/README.md +3 -3
- data/tracks/r/config.json +1 -1
- data/tracks/racket/README.md +2 -2
- data/tracks/racket/config.json +1 -1
- data/tracks/ruby/README.md +9 -9
- data/tracks/ruby/config.json +1 -1
- data/tracks/rust/config.json +1 -1
- data/tracks/rust/exercises/gigasecond/src/lib.rs +7 -0
- data/tracks/rust/exercises/protein-translation/example.rs +11 -22
- data/tracks/rust/exercises/protein-translation/tests/proteins.rs +56 -36
- data/tracks/scala/config.json +1 -1
- data/tracks/scala/exercises/all-your-base/src/test/scala/AllYourBaseTest.scala +46 -64
- data/tracks/scala/exercises/rna-transcription/example.scala +1 -3
- data/tracks/scala/exercises/rna-transcription/src/test/scala/RnaTranscriptionTest.scala +19 -23
- data/tracks/scala/exercises/scrabble-score/example.scala +2 -2
- data/tracks/scala/exercises/scrabble-score/src/test/scala/ScrabbleScoreTest.scala +37 -16
- data/tracks/scala/testgen/src/main/scala/AllYourBaseTestGenerator.scala +32 -42
- data/tracks/scala/testgen/src/main/scala/RnaTranscriptionTestGenerator.scala +34 -0
- data/tracks/scala/testgen/src/main/scala/ScrabbleScoreTestGenerator.scala +15 -0
- data/tracks/sml/README.md +1 -3
- data/tracks/sml/config.json +1 -1
- data/tracks/sml/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/swift/config.json +1 -1
- data/tracks/typescript/README.md +1 -1
- data/tracks/typescript/config.json +1 -1
- data/tracks/vimscript/README.md +5 -5
- data/tracks/vimscript/config.json +8 -1
- data/tracks/vimscript/exercises/largest-series-product/example.vim +31 -0
- data/tracks/vimscript/exercises/largest-series-product/largest_series_product.vader +95 -0
- data/tracks/vimscript/exercises/largest-series-product/largest_series_product.vim +17 -0
- metadata +13 -2
@@ -0,0 +1,17 @@
|
|
1
|
+
This exercise introduces work with Julia's [type system](http://docs.julialang.org/en/stable/manual/types/)
|
2
|
+
and random [numbers](http://docs.julialang.org/en/stable/stdlib/numbers/).
|
3
|
+
|
4
|
+
Let's create a structure that will describe our robots
|
5
|
+
and then use it to create new instances and to work with them.
|
6
|
+
|
7
|
+
Generate the robot's name using randomness and don't worry about
|
8
|
+
collisions, tests sometimes will fail and that's alright.
|
9
|
+
|
10
|
+
Resetting the robot to the factory settings is like a surgery,
|
11
|
+
so we declare a method that will reset the robot's settings.
|
12
|
+
Take a note that skeleton method reset! has an exclamation mark suffix
|
13
|
+
meaning that the method changes given argument's contents.
|
14
|
+
|
15
|
+
Futhermore, experiment with testing and check out the situations when
|
16
|
+
there are lots of collisions (like when you generate name one thousand times).
|
17
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# http://docs.julialang.org/en/stable/stdlib/numbers/#random-numbers
|
2
|
+
|
3
|
+
new_name() = join(map(x->Char(x), rand(65:90, 2))) * repr(rand(100:999))
|
4
|
+
|
5
|
+
mutable struct Robot
|
6
|
+
name::AbstractString
|
7
|
+
|
8
|
+
Robot() = new(new_name())
|
9
|
+
end
|
10
|
+
|
11
|
+
function reset!(instance::Robot)
|
12
|
+
instance.name = new_name()
|
13
|
+
instance
|
14
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
using Base.Test
|
2
|
+
|
3
|
+
include("robot-name.jl")
|
4
|
+
|
5
|
+
# Random names means a risk of collisions.
|
6
|
+
history = []
|
7
|
+
|
8
|
+
isname(x) = ismatch(r"^[A-Z]{2}[0-9]{3}$", x)
|
9
|
+
|
10
|
+
@testset "one robot" begin
|
11
|
+
r1 = Robot()
|
12
|
+
push!(history, r1.name)
|
13
|
+
|
14
|
+
@testset "name of robot is valid" begin
|
15
|
+
@test isname(r1.name)
|
16
|
+
end
|
17
|
+
|
18
|
+
@testset "names of robot instance are valid and unique in history" for i=1:100
|
19
|
+
reset!(r1)
|
20
|
+
@test isname(r1.name)
|
21
|
+
@test !in(r1.name, history)
|
22
|
+
push!(history, r1.name)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
@testset "two robots" begin
|
27
|
+
r2 = Robot()
|
28
|
+
r3 = Robot()
|
29
|
+
|
30
|
+
@testset "names of robots are valid" begin
|
31
|
+
@test isname(r2.name)
|
32
|
+
@test isname(r3.name)
|
33
|
+
end
|
34
|
+
|
35
|
+
@testset "names of robots are not equal" begin
|
36
|
+
@test r2.name != r3.name
|
37
|
+
end
|
38
|
+
|
39
|
+
@testset "names of both robots are unique in history" begin
|
40
|
+
@test !in(r2.name, history)
|
41
|
+
@test !in(r3.name, history)
|
42
|
+
end
|
43
|
+
|
44
|
+
push!(history, r2.name)
|
45
|
+
push!(history, r3.name)
|
46
|
+
end
|
47
|
+
|
48
|
+
@testset "many robots" begin
|
49
|
+
robots = []
|
50
|
+
|
51
|
+
for i=1:10
|
52
|
+
push!(robots, Robot())
|
53
|
+
|
54
|
+
@testset "name of robot is valid and unique in history" begin
|
55
|
+
@test isname(robots[i].name)
|
56
|
+
@test !in(robots[i].name, history)
|
57
|
+
end
|
58
|
+
|
59
|
+
push!(history, robots[i].name)
|
60
|
+
end
|
61
|
+
|
62
|
+
@testset "fresh names of reset robots are valid and unique in history" for r in robots
|
63
|
+
reset!(r)
|
64
|
+
@test isname(r.name)
|
65
|
+
@test !in(r.name, history)
|
66
|
+
push!(history, r.name)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
data/tracks/kotlin/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# kotlin [](https://travis-ci.org/exercism/kotlin)
|
2
2
|
|
3
3
|
Source for Exercism Exercises in Kotlin.
|
4
4
|
|
@@ -32,13 +32,13 @@ To submit a fix for an existing exercise or port an exercise to Kotlin with the
|
|
32
32
|
1. **Ensure you have the basic Java tooling installed:** JDK 1.8+, an editor and Gradle 2.x.
|
33
33
|
|
34
34
|
(see [exercism.io: Installing Kotlin](http://exercism.io/languages/kotlin/installing))
|
35
|
-
- **Setup a branch on a fork of [exercism/
|
35
|
+
- **Setup a branch on a fork of [exercism/kotlin](https://github.com/exercism/kotlin) on your computer.**
|
36
36
|
|
37
37
|
See [GitHub Help: Forking](https://help.github.com/articles/fork-a-repo/). Use those instructions (in conjunction with [Exercism Contributing Guide](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md#git-basics)) to:
|
38
38
|
* "fork" a repository on GitHub;
|
39
39
|
- install `git`;
|
40
40
|
- "clone" a copy of your fork;
|
41
|
-
- configure an "upstream remote" (in this case, `exercism/
|
41
|
+
- configure an "upstream remote" (in this case, `exercism/kotlin`);
|
42
42
|
- create a branch to house your work
|
43
43
|
- **Write the codes.** Do your work on that branch you just created.
|
44
44
|
|
@@ -59,8 +59,8 @@ To submit a fix for an existing exercise or port an exercise to Kotlin with the
|
|
59
59
|
|
60
60
|
There are two objectives to the design of this build:
|
61
61
|
|
62
|
-
1. when a problem is built from within the
|
63
|
-
2. when a problem is built outside the
|
62
|
+
1. when a problem is built from within the kotlin repo (i.e. when you, the contributor, are developing the exercise), the tests run against the "example" code;
|
63
|
+
2. when a problem is built outside the kotlin repo (when a participant is solving the exercise), the tests run against the "main" code.
|
64
64
|
|
65
65
|
This repo is a multi-project gradle build.
|
66
66
|
|
@@ -109,10 +109,10 @@ and if you review the logs of your x-api, you'll find:
|
|
109
109
|
2015-09-06 15:21:01 - JSON::GeneratorError - source sequence is illegal/malformed utf-8:
|
110
110
|
```
|
111
111
|
|
112
|
-
This is because some files generated by the build can't be served from the x-api. This is by design: the CLI does not serve binaries. To fix this, simply make sure you do a clean in your `
|
112
|
+
This is because some files generated by the build can't be served from the x-api. This is by design: the CLI does not serve binaries. To fix this, simply make sure you do a clean in your `kotlin` repo before you fetch:
|
113
113
|
|
114
114
|
```
|
115
|
-
cd ~/workspace/exercism/
|
115
|
+
cd ~/workspace/exercism/kotlin/exercises
|
116
116
|
gradle clean
|
117
117
|
cd ~/workspace/exercism/exercises
|
118
118
|
exercism fetch kotlin bob
|
data/tracks/kotlin/config.json
CHANGED
data/tracks/kotlin/docs/TESTS.md
CHANGED
@@ -37,7 +37,7 @@ Choose your operating system:
|
|
37
37
|
C:\Users\JohnDoe>gradle test
|
38
38
|
```
|
39
39
|
*(Don't worry about the tests failing, at first, this is how you begin each exercise.)*
|
40
|
-
5. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/
|
40
|
+
5. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/kotlin/blob/master/exercises/hello-world/GETTING_STARTED.md)).
|
41
41
|
|
42
42
|
|
43
43
|
Good luck! Have fun!
|
@@ -70,7 +70,7 @@ If you get stuck, at any point, don't forget to reach out for [help](http://exer
|
|
70
70
|
$ gradle test
|
71
71
|
```
|
72
72
|
*(Don't worry about the tests failing, at first, this is how you begin each exercise.)*
|
73
|
-
4. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/
|
73
|
+
4. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/kotlin/blob/master/exercises/hello-world/GETTING_STARTED.md)).
|
74
74
|
|
75
75
|
Good luck! Have fun!
|
76
76
|
|
@@ -102,7 +102,7 @@ If you get stuck, at any point, don't forget to reach out for [help](http://exer
|
|
102
102
|
$ gradle test
|
103
103
|
```
|
104
104
|
*(Don't worry about the tests failing, at first, this is how you begin each exercise.)*
|
105
|
-
4. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/
|
105
|
+
4. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/kotlin/blob/master/exercises/hello-world/GETTING_STARTED.md)).
|
106
106
|
|
107
107
|
Good luck! Have fun!
|
108
108
|
|
@@ -5,7 +5,7 @@ This guide picks-up where [Running the Tests (in Kotlin)](http://exercism.io/lan
|
|
5
5
|
left off. If you haven't reviewed those instructions, do so now.
|
6
6
|
|
7
7
|
Need more information? A **step-by-step tutorial** is available in this directory at TUTORIAL.md or you can read
|
8
|
-
the [HTML version](https://github.com/exercism/
|
8
|
+
the [HTML version](https://github.com/exercism/kotlin/blob/master/exercises/hello-world/TUTORIAL.md).
|
9
9
|
|
10
10
|
The following instructions work equally well on Windows, Mac OS X and Linux.
|
11
11
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
NOTE: You can also view the HTML version of this file here:
|
2
|
-
https://github.com/exercism/
|
2
|
+
https://github.com/exercism/kotlin/blob/master/exercises/hello-world/TUTORIAL.md
|
3
3
|
|
4
4
|
* [Solving "Hello, World!"](#solving-hello-world)
|
5
5
|
* [Reading Gradle output](#reading-gradle-output)
|
data/tracks/lfe/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# xLFE
|
2
|
-
[](https://ci.appveyor.com/project/yurrriq/
|
2
|
+
[](https://travis-ci.org/exercism/lfe)
|
3
|
+
[](https://ci.appveyor.com/project/yurrriq/lfe/branch/master)
|
4
4
|
|
5
5
|
Exercism problems in Lisp Flavoured Erlang.
|
6
6
|
|
data/tracks/lfe/config.json
CHANGED
data/tracks/lisp/README.md
CHANGED
data/tracks/lisp/config.json
CHANGED
data/tracks/lua/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# Lua
|
2
2
|
|
3
|
-
[](https://travis-ci.org/exercism/lua)
|
4
4
|
|
5
5
|
Exercism exercises in Lua
|
6
6
|
|
@@ -10,15 +10,15 @@ Install Lua, Luarocks, and the Busted testing framework according to the
|
|
10
10
|
[installation instructions][1] for your platform.
|
11
11
|
|
12
12
|
To contribute a patch you will need a GitHub account and you will need to fork
|
13
|
-
the *exercism/
|
14
|
-
Clone your fork with the command: `git clone https://github.com/<your_username>/
|
15
|
-
Create your patch and open a pull request to the exercism/
|
13
|
+
the *exercism/lua* repo to your account.
|
14
|
+
Clone your fork with the command: `git clone https://github.com/<your_username>/lua`.
|
15
|
+
Create your patch and open a pull request to the exercism/lua repo.
|
16
16
|
|
17
17
|
See the GitHub Help for [forking a repo][2] and [creating a pull request][3]
|
18
18
|
if you are unfamiliar with this process.
|
19
19
|
|
20
20
|
To contribute a new exercise, create a folder named after the exercise within the
|
21
|
-
*
|
21
|
+
*lua/exercises* directory. Create your files for a new test, test class and the implementation.
|
22
22
|
|
23
23
|
For example, for the [Bob][4] exercise:
|
24
24
|
|
@@ -33,7 +33,7 @@ Run the test
|
|
33
33
|
|
34
34
|
$ busted .
|
35
35
|
|
36
|
-
Rename *bob.lua* to *example.lua*, and add the exercise to the [
|
36
|
+
Rename *bob.lua* to *example.lua*, and add the exercise to the [lua/config.json][5] file.
|
37
37
|
|
38
38
|
$ tree bob
|
39
39
|
bob
|
@@ -59,8 +59,8 @@ The Lua icon is inspired by the [Lua logo][9], which was designed by Alexandre N
|
|
59
59
|
[1]: http://exercism.io/languages/lua/installing
|
60
60
|
[2]: https://help.github.com/articles/fork-a-repo/
|
61
61
|
[3]: https://help.github.com/articles/creating-a-pull-request/
|
62
|
-
[4]: https://github.com/exercism/
|
63
|
-
[5]: https://github.com/exercism/
|
62
|
+
[4]: https://github.com/exercism/lua/tree/master/exercises/bob
|
63
|
+
[5]: https://github.com/exercism/lua/blob/master/config.json
|
64
64
|
[6]: https://github.com/exercism/docs/tree/master/contributing-to-language-tracks
|
65
65
|
[7]: https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/pull-request-guidelines.md
|
66
66
|
[8]: http://exercism.io/languages/lua/resources
|
data/tracks/lua/config.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
local compute = require('hamming').compute
|
2
2
|
|
3
3
|
describe('hamming', function ()
|
4
|
-
it('
|
4
|
+
it('identical strands', function ()
|
5
5
|
assert.are.equal(0, compute('A', 'A'))
|
6
6
|
end)
|
7
7
|
|
@@ -9,22 +9,26 @@ describe('hamming', function ()
|
|
9
9
|
assert.are.equal(0, compute('GGACTGA', 'GGACTGA'))
|
10
10
|
end)
|
11
11
|
|
12
|
-
it('complete
|
12
|
+
it('complete distance in single nucleotide strands', function ()
|
13
13
|
assert.are.equal(1, compute('A', 'G'))
|
14
14
|
end)
|
15
15
|
|
16
|
-
it('complete
|
16
|
+
it('complete distance in small strands', function ()
|
17
17
|
assert.are.equal(2, compute('AG', 'CT'))
|
18
18
|
end)
|
19
19
|
|
20
|
-
it('small
|
20
|
+
it('small distance in small strands', function ()
|
21
21
|
assert.are.equal(1, compute('AT', 'CT'))
|
22
22
|
end)
|
23
23
|
|
24
|
-
it('small
|
24
|
+
it('small distance', function ()
|
25
25
|
assert.are.equal(1, compute('GGACG', 'GGTCG'))
|
26
26
|
end)
|
27
27
|
|
28
|
+
it('small distance in long strands', function ()
|
29
|
+
assert.are.equal(2, compute('ACCAGGG', 'ACTATGG'))
|
30
|
+
end)
|
31
|
+
|
28
32
|
it('non unique character in first strand', function ()
|
29
33
|
assert.are.equal(1, compute('AGA', 'AGG'))
|
30
34
|
end)
|
@@ -33,11 +37,15 @@ describe('hamming', function ()
|
|
33
37
|
assert.are.equal(1, compute('AGG', 'AGA'))
|
34
38
|
end)
|
35
39
|
|
36
|
-
it('
|
40
|
+
it('same nucleotides in different positions', function ()
|
41
|
+
assert.are.equal(2, compute('TAG', 'GAT'))
|
42
|
+
end)
|
43
|
+
|
44
|
+
it('large distance', function ()
|
37
45
|
assert.are.equal(4, compute('GATACA', 'GCATAA'))
|
38
46
|
end)
|
39
47
|
|
40
|
-
it('
|
48
|
+
it('large distance in off-by-one strand', function ()
|
41
49
|
assert.are.equal(9, compute('GGACGGATTCTG', 'AGGACGGATTCT'))
|
42
50
|
end)
|
43
51
|
|
@@ -1,43 +1,75 @@
|
|
1
1
|
local raindrops = require('raindrops')
|
2
2
|
|
3
3
|
describe('raindrops', function()
|
4
|
-
it('
|
4
|
+
it('the sound for 1 is 1', function()
|
5
5
|
assert.equal('1', raindrops(1))
|
6
|
-
assert.equal('2', raindrops(2))
|
7
|
-
assert.equal('52', raindrops(52))
|
8
6
|
end)
|
9
7
|
|
10
|
-
it('
|
8
|
+
it('the sound for 3 is Pling', function()
|
11
9
|
assert.equal('Pling', raindrops(3))
|
10
|
+
end)
|
11
|
+
|
12
|
+
it('the sound for 5 is Plang', function()
|
13
|
+
assert.equal('Plang', raindrops(5))
|
14
|
+
end)
|
15
|
+
|
16
|
+
it('the sound for 7 is Plong', function()
|
17
|
+
assert.equal('Plong', raindrops(7))
|
18
|
+
end)
|
19
|
+
|
20
|
+
it('the sound for 6 is Pling as it has a factor 3', function()
|
12
21
|
assert.equal('Pling', raindrops(6))
|
22
|
+
end)
|
23
|
+
|
24
|
+
it('2 to the power 3 does not make a raindrop sound as 3 is the exponent not the base', function()
|
25
|
+
assert.equal('8', raindrops(8))
|
26
|
+
end)
|
27
|
+
|
28
|
+
it('the sound for 9 is Pling as it has a factor 3', function()
|
13
29
|
assert.equal('Pling', raindrops(9))
|
14
30
|
end)
|
15
31
|
|
16
|
-
it('
|
17
|
-
assert.equal('Plang', raindrops(5))
|
32
|
+
it('the sound for 10 is Plang as it has a factor 5', function()
|
18
33
|
assert.equal('Plang', raindrops(10))
|
19
|
-
assert.equal('Plang', raindrops(25))
|
20
34
|
end)
|
21
35
|
|
22
|
-
it('
|
36
|
+
it('the sound for 14 is Plong as it has a factor 7', function()
|
23
37
|
assert.equal('Plong', raindrops(7))
|
24
|
-
assert.equal('Plong', raindrops(14))
|
25
|
-
assert.equal('Plong', raindrops(49))
|
26
38
|
end)
|
27
39
|
|
28
|
-
it('
|
40
|
+
it('the sound for 15 is PlingPlang as it has a factor 3 and 5', function()
|
29
41
|
assert.equal('PlingPlang', raindrops(15))
|
30
42
|
end)
|
31
43
|
|
32
|
-
it('
|
44
|
+
it('the sound for 21 is PlingPlong as it has factors 3 and 7', function()
|
33
45
|
assert.equal('PlingPlong', raindrops(21))
|
34
46
|
end)
|
35
47
|
|
36
|
-
it('
|
48
|
+
it('the sound for 25 is Plang as it has a factor 5', function()
|
49
|
+
assert.equal('Plang', raindrops(25))
|
50
|
+
end)
|
51
|
+
|
52
|
+
it('the sound for 27 is Pling as it has a factor 3', function()
|
53
|
+
assert.equal('Pling', raindrops(27))
|
54
|
+
end)
|
55
|
+
|
56
|
+
it('the sound for 35 is PlangPlong as it has factors 5 and 7', function()
|
37
57
|
assert.equal('PlangPlong', raindrops(35))
|
38
58
|
end)
|
39
59
|
|
40
|
-
it('
|
60
|
+
it('the sound for 49 is Plong as it has a factor 7', function()
|
61
|
+
assert.equal('Plong', raindrops(49))
|
62
|
+
end)
|
63
|
+
|
64
|
+
it('the sound for 52 is 52', function()
|
65
|
+
assert.equal('52', raindrops(52))
|
66
|
+
end)
|
67
|
+
|
68
|
+
it('the sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7', function()
|
41
69
|
assert.equal('PlingPlangPlong', raindrops(105))
|
42
70
|
end)
|
71
|
+
|
72
|
+
it('the sound for 3125 is Plang as it has a factor 5', function()
|
73
|
+
assert.equal('Plang', raindrops(3125))
|
74
|
+
end)
|
43
75
|
end)
|
data/tracks/mips/config.json
CHANGED
@@ -31,7 +31,7 @@ json = JSON.parse contents
|
|
31
31
|
violations = json["violation"]
|
32
32
|
violations.each do |object|
|
33
33
|
shortFile = object["path"]
|
34
|
-
shortFile.sub! "/Users/travis/build/exercism/
|
34
|
+
shortFile.sub! "/Users/travis/build/exercism/objective-c/", ''
|
35
35
|
shortFile = shortFile.to_s || ''
|
36
36
|
msg = object["rule"].to_s || ''
|
37
37
|
line = object["startLine"] || 1
|
data/tracks/ocaml/README.md
CHANGED
@@ -19,7 +19,7 @@ opam install core ounit react
|
|
19
19
|
|
20
20
|
## Running Tests
|
21
21
|
|
22
|
-
To run all the tests, type `make` from the top level
|
22
|
+
To run all the tests, type `make` from the top level ocaml directory.
|
23
23
|
|
24
24
|
To run tests for an individual exercise, `make test-assignment ASSIGNMENT=luhn`
|
25
25
|
|
@@ -60,7 +60,7 @@ is documentation [here](tools/test-generator/README.md).
|
|
60
60
|
|
61
61
|
## Feedback
|
62
62
|
|
63
|
-
If you find this documentation is inaccurate or incomplete, or can be improved in any way, please don't hesitate to raise an [issue](https://github.com/exercism/
|
63
|
+
If you find this documentation is inaccurate or incomplete, or can be improved in any way, please don't hesitate to raise an [issue](https://github.com/exercism/ocaml/issues) or submit a pull request.
|
64
64
|
|
65
65
|
|
66
66
|
### OCaml icon
|
data/tracks/ocaml/config.json
CHANGED
@@ -23,7 +23,7 @@ opam install utop
|
|
23
23
|
Consult [utop](https://github.com/diml/utop/blob/master/README.md) for more detail.
|
24
24
|
|
25
25
|
## Feedback, Issues, Pull Requests
|
26
|
-
The [exercism/
|
26
|
+
The [exercism/ocaml](https://github.com/exercism/ocaml) repository on
|
27
27
|
GitHub is the home for all of the Ocaml exercises.
|
28
28
|
|
29
29
|
If you have feedback about an exercise, or want to help implementing a new
|
@@ -17,9 +17,9 @@ This will build and run the unit tests
|
|
17
17
|
The test generator should be run whenever test canonical data is updated.
|
18
18
|
|
19
19
|
You will need the latest version of x-common checked out locally, at the same level as your
|
20
|
-
|
20
|
+
ocaml repo.
|
21
21
|
|
22
|
-
Please note: running will overwrite tests in the
|
22
|
+
Please note: running will overwrite tests in the ocaml/exercises folders (this is the default, there
|
23
23
|
is a command line option to write the tests to a different folder - run test_gen.native --help).
|
24
24
|
|
25
25
|
To run, type test_gen.native at the command line.
|
data/tracks/perl5/README.md
CHANGED
data/tracks/perl5/config.json
CHANGED
data/tracks/perl6/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# Exercism Perl 6 Track
|
2
2
|
|
3
|
-
[](https://travis-ci.org/exercism/perl6) [](https://gitter.im/exercism/perl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
4
4
|
|
5
5
|
Exercism exercises in Perl 6
|
6
6
|
|