trackler 2.2.1.169 → 2.2.1.170
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/isbn-verifier/canonical-data.json +9 -1
- data/tracks/ballerina/.gitignore +1 -0
- data/tracks/ballerina/.travis.yml +20 -2
- data/tracks/ballerina/config.json +15 -5
- data/tracks/ballerina/config/maintainers.json +13 -2
- data/tracks/ballerina/exercises/.ballerina/.gitignore +2 -0
- data/tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal +17 -0
- data/tracks/ballerina/exercises/hello-world-service/hello_world_service.bal +10 -0
- data/tracks/ballerina/exercises/hello-world-service/hello_world_service.client.out +3 -0
- data/tracks/ballerina/exercises/hello-world-service/hello_world_service.description +3 -0
- data/tracks/ballerina/exercises/hello-world-service/hello_world_service.server.out +12 -0
- data/tracks/ballerina/exercises/hello-world-service/tests/hello_world_service_test.bal +36 -0
- data/tracks/ballerina/exercises/hello-world/.meta/reference/hello_world.bal +5 -0
- data/tracks/ballerina/exercises/hello-world/README.md +21 -0
- data/tracks/ballerina/exercises/hello-world/hello_world.bal +6 -0
- data/tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal +22 -0
- data/tracks/ballerina/exercises/run_ballerina_tests.sh +30 -0
- data/tracks/kotlin/exercises/difference-of-squares/.meta/version +1 -1
- data/tracks/kotlin/exercises/perfect-numbers/.meta/version +1 -1
- data/tracks/kotlin/exercises/raindrops/.meta/version +1 -1
- data/tracks/kotlin/exercises/scrabble-score/.meta/version +1 -1
- data/tracks/kotlin/exercises/secret-handshake/.meta/version +1 -1
- data/tracks/kotlin/exercises/space-age/.meta/version +1 -1
- data/tracks/kotlin/exercises/sum-of-multiples/.meta/version +1 -1
- data/tracks/powershell/exercises/bob/BobResponse.example.ps1 +24 -0
- data/tracks/powershell/exercises/bob/BobResponse.ps1 +24 -0
- data/tracks/powershell/exercises/hamming/HammingDifference.example.ps1 +27 -0
- data/tracks/powershell/exercises/hamming/HammingDifference.ps1 +27 -0
- data/tracks/powershell/exercises/hello-world/HelloWorld.example.ps1 +13 -0
- data/tracks/powershell/exercises/hello-world/HelloWorld.ps1 +13 -0
- data/tracks/powershell/exercises/leap/LeapYear.example.ps1 +27 -0
- data/tracks/powershell/exercises/leap/LeapYear.ps1 +25 -0
- data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.example.ps1 +21 -0
- data/tracks/powershell/exercises/nucleotide-count/NucleotideCount.ps1 +21 -0
- data/tracks/powershell/exercises/raindrops/Raindrops.example.ps1 +25 -0
- data/tracks/powershell/exercises/raindrops/Raindrops.ps1 +25 -0
- data/tracks/powershell/exercises/reverse-string/ReverseString.example.ps1 +18 -11
- data/tracks/powershell/exercises/reverse-string/ReverseString.ps1 +18 -10
- data/tracks/powershell/exercises/sum-of-multiples/SumOfMultiples.example.ps1 +17 -15
- data/tracks/powershell/exercises/sum-of-multiples/SumOfMultiples.ps1 +17 -15
- data/tracks/powershell/exercises/two-fer/TwoFer.example.ps1 +21 -0
- data/tracks/powershell/exercises/two-fer/TwoFer.ps1 +21 -0
- data/tracks/rust/config.json +11 -1
- data/tracks/rust/config/maintainers.json +34 -28
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 408d82244ac628e626dc56a53945bd9e6c300e55
|
4
|
+
data.tar.gz: 6c3d74efe041daa41b8c8c3837a9627f2778a330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 799e7ad0edec826f96aa0136b91b9a8df1abe03c63d3edc7cdf2096e8deb36943570c87bf59e2e52b9d84fb0dc2ef4647498e65a77112ef280678badeb238056
|
7
|
+
data.tar.gz: d778ec6e0242da6518b8a207bed5b248c3a7d910d450500e3768d7576e04181f7a25c546f0dbacf0fa441f44ee84be891339e27a13a3b2269710bac15c4de5cc
|
data/lib/trackler/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"exercise": "isbn-verifier",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.6.0",
|
4
4
|
"comments": [
|
5
5
|
"An expected value of true indicates a valid ISBN-10, ",
|
6
6
|
"whereas false means the ISBN-10 is invalid."
|
@@ -86,6 +86,14 @@
|
|
86
86
|
},
|
87
87
|
"expected": false
|
88
88
|
},
|
89
|
+
{
|
90
|
+
"description": "too short isbn",
|
91
|
+
"property": "isValid",
|
92
|
+
"input": {
|
93
|
+
"isbn": "00"
|
94
|
+
},
|
95
|
+
"expected": false
|
96
|
+
},
|
89
97
|
{
|
90
98
|
"description": "isbn without check digit",
|
91
99
|
"property": "isValid",
|
data/tracks/ballerina/.gitignore
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
language: bash
|
2
2
|
|
3
3
|
script:
|
4
|
-
- bin/fetch-configlet
|
5
|
-
- bin/configlet lint --track TRACK_ID .
|
4
|
+
# - bin/fetch-configlet
|
5
|
+
# - bin/configlet lint --track TRACK_ID .
|
6
|
+
- STRING="Downloading ballerina..."
|
7
|
+
- BALLERINA_VERSION="ballerina-platform-0.970.0"
|
8
|
+
- echo $STRING
|
9
|
+
# Download Ballerina dist
|
10
|
+
- wget https://product-dist.ballerina.io/downloads/0.970.0/$BALLERINA_VERSION.zip
|
11
|
+
|
12
|
+
# Unzip the zip file
|
13
|
+
- unzip $BALLERINA_VERSION.zip
|
14
|
+
|
15
|
+
# Add Ballerina to the path variable
|
16
|
+
- export PATH=$PATH:$(pwd)/$BALLERINA_VERSION/bin
|
17
|
+
|
18
|
+
# Print Ballerina version
|
19
|
+
- ballerina version
|
20
|
+
|
21
|
+
# Change the directory
|
22
|
+
- cd exercises
|
23
|
+
- sh run_ballerina_tests.sh
|
@@ -2,10 +2,20 @@
|
|
2
2
|
"track_id": "ballerina",
|
3
3
|
"language": "Ballerina",
|
4
4
|
"active": false,
|
5
|
+
"blurb": "",
|
5
6
|
"ignore_pattern": "[Ee]xample",
|
6
|
-
"solution_pattern": "
|
7
|
+
"solution_pattern": "reference",
|
7
8
|
"test_pattern": "[Tt]est",
|
8
|
-
"
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
"exercises": [
|
10
|
+
{
|
11
|
+
"slug": "hello-world",
|
12
|
+
"uuid": "91441035-67fa-40e3-a4d5-39476801172a",
|
13
|
+
"core": true,
|
14
|
+
"unlocked_by": null,
|
15
|
+
"difficulty": 1,
|
16
|
+
"topics": [
|
17
|
+
"strings"
|
18
|
+
]
|
19
|
+
}
|
20
|
+
]
|
21
|
+
}
|
@@ -1,4 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"docs_url": "https://github.com/exercism/docs/blob/master/maintaining-a-track/maintainer-configuration.md",
|
3
|
-
"maintainers": [
|
4
|
-
|
3
|
+
"maintainers": [
|
4
|
+
{
|
5
|
+
"github_username": "kasun04",
|
6
|
+
"alumnus": true,
|
7
|
+
"show_on_website": false,
|
8
|
+
"name": null,
|
9
|
+
"link_text": null,
|
10
|
+
"link_url": null,
|
11
|
+
"avatar_url": null,
|
12
|
+
"bio": null
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import ballerina/http;
|
2
|
+
import ballerina/log;
|
3
|
+
|
4
|
+
// By default, Ballerina exposes a service via HTTP/1.1.
|
5
|
+
service<http:Service> hello bind { port: 9090 } {
|
6
|
+
|
7
|
+
// Invoke all resources with arguments of server connector and request.
|
8
|
+
sayHello(endpoint caller, http:Request req) {
|
9
|
+
http:Response res = new;
|
10
|
+
// Use a util method to set a string payload.
|
11
|
+
res.setPayload("Hello, World!");
|
12
|
+
|
13
|
+
// Send the response back to the caller.
|
14
|
+
caller->respond(res) but { error e => log:printError(
|
15
|
+
"Error sending response", err = e) };
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import ballerina/http;
|
2
|
+
import ballerina/log;
|
3
|
+
|
4
|
+
// By default, Ballerina exposes a service via HTTP/1.1.
|
5
|
+
service<http:Service> hello bind { port: 9090 } {
|
6
|
+
|
7
|
+
// Invoke all resources with arguments of server connector and request.
|
8
|
+
sayHello(endpoint caller, http:Request req) {
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# To start the service, navigate to the directory that contains the
|
2
|
+
# `.bal` file and use the `ballerina run` command.
|
3
|
+
$ ballerina run hello_world_service.bal
|
4
|
+
ballerina: initiating service(s) in 'hello_world_service.bal'
|
5
|
+
ballerina: started HTTP/WS server connector 0.0.0.0:9090
|
6
|
+
|
7
|
+
# To build a compiled program file, use the
|
8
|
+
# `ballerina build` command followed by
|
9
|
+
# the service package.
|
10
|
+
$ ballerina build hello_world_service.bal
|
11
|
+
$ ls
|
12
|
+
hello_world_service.balx hello_world_service.bal
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import ballerina/test;
|
2
|
+
import ballerina/io;
|
3
|
+
import ballerina/http;
|
4
|
+
|
5
|
+
boolean serviceStarted;
|
6
|
+
|
7
|
+
function startService() {
|
8
|
+
serviceStarted = test:startServices("hello-world-service");
|
9
|
+
}
|
10
|
+
|
11
|
+
@test:Config {
|
12
|
+
before: "startService",
|
13
|
+
after: "stopService"
|
14
|
+
}
|
15
|
+
function testFunc() {
|
16
|
+
// Invoking the main function
|
17
|
+
endpoint http:Client httpEndpoint { url: "http://localhost:9090" };
|
18
|
+
// Chck whether the server is started
|
19
|
+
test:assertTrue(serviceStarted, msg = "Unable to start the service");
|
20
|
+
|
21
|
+
string response1 = "Hello, World!";
|
22
|
+
|
23
|
+
// Send a GET request to the specified endpoint
|
24
|
+
var response = httpEndpoint->get("/hello/sayHello");
|
25
|
+
match response {
|
26
|
+
http:Response resp => {
|
27
|
+
var res = check resp.getTextPayload();
|
28
|
+
test:assertEquals(res, response1);
|
29
|
+
}
|
30
|
+
error err => test:assertFail(msg = "Failed to call the endpoint:");
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
function stopService() {
|
35
|
+
test:stopServices("hello-world-service");
|
36
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Hello World
|
2
|
+
|
3
|
+
The classical introductory exercise. Just say "Hello, World!".
|
4
|
+
|
5
|
+
["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
|
6
|
+
the traditional first program for beginning programming in a new language
|
7
|
+
or environment.
|
8
|
+
|
9
|
+
The objectives are simple:
|
10
|
+
|
11
|
+
- Write a function that returns the string "Hello, World!".
|
12
|
+
- Run the test suite and make sure that it succeeds.
|
13
|
+
- Submit your solution and check it at the website.
|
14
|
+
|
15
|
+
If everything goes well, you will be ready to fetch your first real exercise.
|
16
|
+
## Source
|
17
|
+
|
18
|
+
This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program)
|
19
|
+
|
20
|
+
## Submitting Incomplete Solutions
|
21
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import ballerina/test;
|
2
|
+
import ballerina/io;
|
3
|
+
|
4
|
+
any[] outputs = [];
|
5
|
+
int counter = 0;
|
6
|
+
|
7
|
+
// This is the mock function which will replace the real function
|
8
|
+
@test:Mock {
|
9
|
+
packageName: "ballerina.io",
|
10
|
+
functionName: "println"
|
11
|
+
}
|
12
|
+
public function mockPrint(any... s) {
|
13
|
+
outputs[counter] = s[0];
|
14
|
+
counter++;
|
15
|
+
}
|
16
|
+
|
17
|
+
@test:Config
|
18
|
+
function testFunc() {
|
19
|
+
// Invoking the main function
|
20
|
+
main();
|
21
|
+
test:assertEquals("Hello, World!", outputs[0]);
|
22
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
|
4
|
+
for dir in ./*/
|
5
|
+
do
|
6
|
+
dir=${dir%*/}
|
7
|
+
test_name=${dir##*/}
|
8
|
+
echo $test_name
|
9
|
+
|
10
|
+
if [ -d temp_test ]; then
|
11
|
+
echo "Cleaning temp files..."
|
12
|
+
rm -r temp_test
|
13
|
+
fi
|
14
|
+
|
15
|
+
mkdir temp_test
|
16
|
+
cp -r $test_name ./temp_test
|
17
|
+
rm -r ./temp_test/$test_name/.meta
|
18
|
+
cp -r $test_name/.meta/reference/* ./temp_test/$test_name
|
19
|
+
cp -r ./.ballerina ./temp_test
|
20
|
+
cd ./temp_test
|
21
|
+
ballerina init
|
22
|
+
ballerina test $test_name
|
23
|
+
cd ..
|
24
|
+
rm -r temp_test
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
done
|
30
|
+
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
@@ -1,4 +1,28 @@
|
|
1
1
|
Function Get-BobResponse() {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
|
8
|
+
|
9
|
+
Bob answers 'Sure.' if you ask him a question.
|
10
|
+
|
11
|
+
He answers 'Whoa, chill out!' if you yell at him.
|
12
|
+
|
13
|
+
He answers 'Calm down, I know what I'm doing!' if you yell a question at him.
|
14
|
+
|
15
|
+
He says 'Fine. Be that way!' if you address him without actually saying
|
16
|
+
anything.
|
17
|
+
|
18
|
+
He answers 'Whatever.' to anything else.
|
19
|
+
|
20
|
+
.PARAMETER HeyBob
|
21
|
+
The sentence you say to Bob.
|
22
|
+
|
23
|
+
.EXAMPLE
|
24
|
+
Get-BobResponse -HeyBob "Hi Bob"
|
25
|
+
#>
|
2
26
|
[CmdletBinding()]
|
3
27
|
Param(
|
4
28
|
[string]$HeyBob
|
@@ -1,4 +1,28 @@
|
|
1
1
|
Function Get-BobResponse() {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
|
8
|
+
|
9
|
+
Bob answers 'Sure.' if you ask him a question.
|
10
|
+
|
11
|
+
He answers 'Whoa, chill out!' if you yell at him.
|
12
|
+
|
13
|
+
He answers 'Calm down, I know what I'm doing!' if you yell a question at him.
|
14
|
+
|
15
|
+
He says 'Fine. Be that way!' if you address him without actually saying
|
16
|
+
anything.
|
17
|
+
|
18
|
+
He answers 'Whatever.' to anything else.
|
19
|
+
|
20
|
+
.PARAMETER HeyBob
|
21
|
+
The sentence you say to Bob.
|
22
|
+
|
23
|
+
.EXAMPLE
|
24
|
+
Get-BobResponse -HeyBob "Hi Bob"
|
25
|
+
#>
|
2
26
|
[CmdletBinding()]
|
3
27
|
Param(
|
4
28
|
[string]$HeyBob
|
@@ -1,4 +1,31 @@
|
|
1
1
|
function Get-HammingDifference([string]$strand1, [string]$strand2) {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Calculate the Hamming difference between two DNA strands.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
By counting the number of differences between two homologous DNA strands
|
8
|
+
taken from different genomes with a common ancestor, we get a measure of
|
9
|
+
the minimum number of point mutations that could have occurred on the
|
10
|
+
evolutionary path between the two strands.
|
11
|
+
|
12
|
+
This is called the 'Hamming distance'.
|
13
|
+
|
14
|
+
It is found by comparing two DNA strands and counting how many of the
|
15
|
+
nucleotides are different from their equivalent in the other string.
|
16
|
+
|
17
|
+
.PARAMETER strand1
|
18
|
+
The first DNA strand
|
19
|
+
|
20
|
+
.PARAMETER strand2
|
21
|
+
The second DNA strand
|
22
|
+
|
23
|
+
.EXAMPLE
|
24
|
+
Get-HammingDifference -strand1 "GAGCCTACTAACGGGAT" -strand2 "CATCGTAATGACGGCCT"
|
25
|
+
|
26
|
+
This will return a difference of 7.
|
27
|
+
#>
|
28
|
+
|
2
29
|
if ( $strand1.length -ne $strand2.length) {
|
3
30
|
Throw "Mismatching string lengths"
|
4
31
|
}
|
@@ -1,3 +1,30 @@
|
|
1
1
|
function Get-HammingDifference([string]$strand1, [string]$strand2) {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Calculate the Hamming difference between two DNA strands.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
By counting the number of differences between two homologous DNA strands
|
8
|
+
taken from different genomes with a common ancestor, we get a measure of
|
9
|
+
the minimum number of point mutations that could have occurred on the
|
10
|
+
evolutionary path between the two strands.
|
11
|
+
|
12
|
+
This is called the 'Hamming distance'.
|
13
|
+
|
14
|
+
It is found by comparing two DNA strands and counting how many of the
|
15
|
+
nucleotides are different from their equivalent in the other string.
|
16
|
+
|
17
|
+
.PARAMETER strand1
|
18
|
+
The first DNA strand
|
19
|
+
|
20
|
+
.PARAMETER strand2
|
21
|
+
The second DNA strand
|
22
|
+
|
23
|
+
.EXAMPLE
|
24
|
+
Get-HammingDifference -strand1 "GAGCCTACTAACGGGAT" -strand2 "CATCGTAATGACGGCCT"
|
25
|
+
|
26
|
+
This will return a difference of 7.
|
27
|
+
#>
|
28
|
+
|
2
29
|
Throw "Exercise not implemented"
|
3
30
|
}
|
@@ -1,4 +1,17 @@
|
|
1
1
|
function Get-HelloWorld {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Outputs "Hello World"
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Output "Hello World" or "Hello <Name>" if Name is supplied to the CmdLet.
|
8
|
+
|
9
|
+
.PARAMETER person
|
10
|
+
Name of the person to display. If not supplied, Hello World should be displayed
|
11
|
+
|
12
|
+
.EXAMPLE
|
13
|
+
Get-HelloWorld
|
14
|
+
#>
|
2
15
|
param( [string]$person = "World")
|
3
16
|
|
4
17
|
return "Hello, $person!"
|
@@ -1,4 +1,17 @@
|
|
1
1
|
function Get-HelloWorld {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Outputs "Hello World"
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Output "Hello World" or "Hello <Name>" if Name is supplied to the CmdLet.
|
8
|
+
|
9
|
+
.PARAMETER person
|
10
|
+
Name of the person to display. If not supplied, Hello World should be displayed
|
11
|
+
|
12
|
+
.EXAMPLE
|
13
|
+
Get-HelloWorld
|
14
|
+
#>
|
2
15
|
param([string]$person = "World")
|
3
16
|
|
4
17
|
Throw "Exercise not implemented"
|
@@ -1,5 +1,32 @@
|
|
1
1
|
function Test-LeapYear {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a year, report if it is a leap year.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Calculate whether the supplied year is a leap year. A leap year is determined from the following
|
8
|
+
calculation:
|
9
|
+
|
10
|
+
on every year that is evenly divisible by 4
|
11
|
+
except every year that is evenly divisible by 100
|
12
|
+
unless the year is also evenly divisible by 400
|
13
|
+
|
14
|
+
.PARAMETER year
|
15
|
+
The year to test
|
16
|
+
|
17
|
+
.EXAMPLE
|
18
|
+
Test-LeapYear -year 2018
|
19
|
+
|
20
|
+
Returns false
|
21
|
+
|
22
|
+
.EXAMPLE
|
23
|
+
Test-LeapYear -year 2020
|
24
|
+
|
25
|
+
Returns True
|
26
|
+
#>
|
27
|
+
|
2
28
|
param( [int]$year )
|
29
|
+
|
3
30
|
# This could be solved using the native system.datetime object
|
4
31
|
# but that isn't in the spirit of exercism.
|
5
32
|
#[system.datetime]::isleapyear($year)
|
@@ -1,4 +1,29 @@
|
|
1
1
|
function Test-LeapYear {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a year, report if it is a leap year.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Calculate whether the supplied year is a leap year. A leap year is determined from the following
|
8
|
+
calculation:
|
9
|
+
|
10
|
+
on every year that is evenly divisible by 4
|
11
|
+
except every year that is evenly divisible by 100
|
12
|
+
unless the year is also evenly divisible by 400
|
13
|
+
|
14
|
+
.PARAMETER year
|
15
|
+
The year to test
|
16
|
+
|
17
|
+
.EXAMPLE
|
18
|
+
Test-LeapYear -year 2018
|
19
|
+
|
20
|
+
Returns false
|
21
|
+
|
22
|
+
.EXAMPLE
|
23
|
+
Test-LeapYear -year 2020
|
24
|
+
|
25
|
+
Returns True
|
26
|
+
#>
|
2
27
|
param( [int]$year )
|
3
28
|
|
4
29
|
Throw "Exercise not implemented"
|
@@ -1,4 +1,25 @@
|
|
1
1
|
Function Get-NucleotideCount() {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
The genetic language of every living thing on the planet is DNA.
|
8
|
+
DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides.
|
9
|
+
4 types exist in DNA and these differ only slightly and can be represented as the following symbols: 'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' thymine.
|
10
|
+
|
11
|
+
The function counts the occurances of A, C, G and T in the supplied strand. It then outputs in the format:
|
12
|
+
|
13
|
+
A:0, C:0, G:0, T:0
|
14
|
+
|
15
|
+
.PARAMETER Strand
|
16
|
+
The DNA strand to count
|
17
|
+
|
18
|
+
.EXAMPLE
|
19
|
+
Get-NucleotideCount -Strand "ACGTAGCTT"
|
20
|
+
|
21
|
+
Retuns: A:2 C:2 G:2 T:3
|
22
|
+
#>
|
2
23
|
[CmdletBinding()]
|
3
24
|
Param(
|
4
25
|
[string]$Strand = ""
|
@@ -1,4 +1,25 @@
|
|
1
1
|
Function Get-NucleotideCount() {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
The genetic language of every living thing on the planet is DNA.
|
8
|
+
DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides.
|
9
|
+
4 types exist in DNA and these differ only slightly and can be represented as the following symbols: 'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' thymine.
|
10
|
+
|
11
|
+
The function counts the occurances of A, C, G and T in the supplied strand. It then outputs in the format:
|
12
|
+
|
13
|
+
A:0, C:0, G:0, T:0
|
14
|
+
|
15
|
+
.PARAMETER Strand
|
16
|
+
The DNA strand to count
|
17
|
+
|
18
|
+
.EXAMPLE
|
19
|
+
Get-NucleotideCount -Strand "ACGTAGCTT"
|
20
|
+
|
21
|
+
Retuns: A:2 C:2 G:2 T:3
|
22
|
+
#>
|
2
23
|
[CmdletBinding()]
|
3
24
|
Param(
|
4
25
|
[string]$Strand
|
@@ -1,4 +1,29 @@
|
|
1
1
|
Function Get-Raindrops() {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a number convert it to Pling, Plang, Plong if it has factors of 3, 5 or 7.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Convert a number to a string, the contents of which depend on the number's factors.
|
8
|
+
|
9
|
+
- If the number has 3 as a factor, output 'Pling'.
|
10
|
+
- If the number has 5 as a factor, output 'Plang'.
|
11
|
+
- If the number has 7 as a factor, output 'Plong'.
|
12
|
+
- If the number does not have 3, 5, or 7 as a factor, just pass the number's digits straight through.
|
13
|
+
|
14
|
+
.PARAMETER Rain
|
15
|
+
The number to evaluate
|
16
|
+
|
17
|
+
.EXAMPLE
|
18
|
+
Get-Raindrops -Rain 35
|
19
|
+
|
20
|
+
This will return PlangPlong as it has factors of 5 and 7
|
21
|
+
|
22
|
+
.EXAMPLE
|
23
|
+
Get-Raindrops -Rain 12121
|
24
|
+
|
25
|
+
This will return 12121 as it does not contain factors of 3, 5 or 7 so the value is passed through.
|
26
|
+
#>
|
2
27
|
[CmdletBinding()]
|
3
28
|
Param(
|
4
29
|
[int]$Rain
|
@@ -1,4 +1,29 @@
|
|
1
1
|
Function Get-Raindrops() {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a number convert it to Pling, Plang, Plong if it has factors of 3, 5 or 7.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
Convert a number to a string, the contents of which depend on the number's factors.
|
8
|
+
|
9
|
+
- If the number has 3 as a factor, output 'Pling'.
|
10
|
+
- If the number has 5 as a factor, output 'Plang'.
|
11
|
+
- If the number has 7 as a factor, output 'Plong'.
|
12
|
+
- If the number does not have 3, 5, or 7 as a factor, just pass the number's digits straight through.
|
13
|
+
|
14
|
+
.PARAMETER Rain
|
15
|
+
The number to evaluate
|
16
|
+
|
17
|
+
.EXAMPLE
|
18
|
+
Get-Raindrops -Rain 35
|
19
|
+
|
20
|
+
This will return PlangPlong as it has factors of 5 and 7
|
21
|
+
|
22
|
+
.EXAMPLE
|
23
|
+
Get-Raindrops -Rain 12121
|
24
|
+
|
25
|
+
This will return 12121 as it does not contain factors of 3, 5 or 7 so the value is passed through.
|
26
|
+
#>
|
2
27
|
[CmdletBinding()]
|
3
28
|
Param(
|
4
29
|
[int]$Rain
|
@@ -1,17 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
Function Get-ReverseString {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Reverse a string
|
4
5
|
|
5
|
-
.DESCRIPTION
|
6
|
-
Reverses the string in its entirety. That is it does not reverse each word in a string individually.
|
6
|
+
.DESCRIPTION
|
7
|
+
Reverses the string in its entirety. That is it does not reverse each word in a string individually.
|
7
8
|
|
8
|
-
.PARAMETER Forward
|
9
|
-
The string to be reversed
|
9
|
+
.PARAMETER Forward
|
10
|
+
The string to be reversed
|
10
11
|
|
11
|
-
.EXAMPLE
|
12
|
-
Get-ReverseString "PowerShell"
|
13
|
-
|
14
|
-
|
12
|
+
.EXAMPLE
|
13
|
+
Get-ReverseString "PowerShell"
|
14
|
+
|
15
|
+
This will return llehSrewoP
|
16
|
+
|
17
|
+
.EXAMPLE
|
18
|
+
Get-ReverseString "racecar"
|
19
|
+
|
20
|
+
This will return racecar as it is a palindrome
|
21
|
+
#>
|
15
22
|
[CmdletBinding()]
|
16
23
|
Param(
|
17
24
|
[Parameter(Position=1, ValueFromPipeline=$true)]
|
@@ -1,16 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
Function Get-ReverseString {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Reverse a string
|
4
5
|
|
5
|
-
.DESCRIPTION
|
6
|
-
Reverses the string in its entirety. That is it does not reverse each word in a string individually.
|
6
|
+
.DESCRIPTION
|
7
|
+
Reverses the string in its entirety. That is it does not reverse each word in a string individually.
|
7
8
|
|
8
|
-
.PARAMETER Forward
|
9
|
-
The string to be reversed
|
9
|
+
.PARAMETER Forward
|
10
|
+
The string to be reversed
|
10
11
|
|
11
|
-
.EXAMPLE
|
12
|
-
Get-ReverseString "PowerShell"
|
13
|
-
|
12
|
+
.EXAMPLE
|
13
|
+
Get-ReverseString "PowerShell"
|
14
|
+
|
15
|
+
This will return llehSrewoP
|
16
|
+
|
17
|
+
.EXAMPLE
|
18
|
+
Get-ReverseString "racecar"
|
19
|
+
|
20
|
+
This will return racecar as it is a palindrome
|
21
|
+
#>
|
14
22
|
[CmdletBinding()]
|
15
23
|
Param(
|
16
24
|
[Parameter(Position=1, ValueFromPipeline=$true)]
|
@@ -1,22 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
Function Get-SumOfMultiples {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a number, find the sum of all the unique multiples of particular numbers up to
|
5
|
+
but not including that number.
|
5
6
|
|
6
|
-
.DESCRIPTION
|
7
|
-
If we list all the natural numbers below 20 that are multiples of 3 or 5,
|
8
|
-
we get 3, 5, 6, 9, 10, 12, 15, and 18.
|
7
|
+
.DESCRIPTION
|
8
|
+
If we list all the natural numbers below 20 that are multiples of 3 or 5,
|
9
|
+
we get 3, 5, 6, 9, 10, 12, 15, and 18.
|
9
10
|
|
10
|
-
.PARAMETER Multiples
|
11
|
-
An array of the factors
|
11
|
+
.PARAMETER Multiples
|
12
|
+
An array of the factors
|
12
13
|
|
13
|
-
.PARAMETER Limit
|
14
|
-
The value BELOW which we test for
|
14
|
+
.PARAMETER Limit
|
15
|
+
The value BELOW which we test for
|
15
16
|
|
16
|
-
.EXAMPLE
|
17
|
-
Get-SumOfMultiples -Multiples @(3, 5) -Limit 10
|
18
|
-
|
19
|
-
|
17
|
+
.EXAMPLE
|
18
|
+
Get-SumOfMultiples -Multiples @(3, 5) -Limit 10
|
19
|
+
|
20
|
+
Returns 23
|
21
|
+
#>
|
20
22
|
[CmdletBinding()]
|
21
23
|
Param(
|
22
24
|
[int[]]$Multiples,
|
@@ -1,22 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
Function Get-SumOfMultiples {
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
Given a number, find the sum of all the unique multiples of particular numbers up to
|
5
|
+
but not including that number.
|
5
6
|
|
6
|
-
.DESCRIPTION
|
7
|
-
If we list all the natural numbers below 20 that are multiples of 3 or 5,
|
8
|
-
we get 3, 5, 6, 9, 10, 12, 15, and 18.
|
7
|
+
.DESCRIPTION
|
8
|
+
If we list all the natural numbers below 20 that are multiples of 3 or 5,
|
9
|
+
we get 3, 5, 6, 9, 10, 12, 15, and 18.
|
9
10
|
|
10
|
-
.PARAMETER Multiples
|
11
|
-
An array of the factors
|
11
|
+
.PARAMETER Multiples
|
12
|
+
An array of the factors
|
12
13
|
|
13
|
-
.PARAMETER Limit
|
14
|
-
The value BELOW which we test for
|
14
|
+
.PARAMETER Limit
|
15
|
+
The value BELOW which we test for
|
15
16
|
|
16
|
-
.EXAMPLE
|
17
|
-
Get-SumOfMultiples -Multiples @(3, 5) -Limit 10
|
18
|
-
|
19
|
-
|
17
|
+
.EXAMPLE
|
18
|
+
Get-SumOfMultiples -Multiples @(3, 5) -Limit 10
|
19
|
+
|
20
|
+
Returns 23
|
21
|
+
#>
|
20
22
|
[CmdletBinding()]
|
21
23
|
Param(
|
22
24
|
[int[]]$Multiples,
|
@@ -1,4 +1,25 @@
|
|
1
1
|
Function Get-TwoFer(){
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
"Two-fer" is short for two for one. One for you and one for me.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
If the given name is "Alice", the result should be "One for Alice, one for me."
|
8
|
+
If no name is given, the result should be "One for you, one for me."
|
9
|
+
|
10
|
+
.PARAMETER Name
|
11
|
+
The name to use.
|
12
|
+
|
13
|
+
.EXAMPLE
|
14
|
+
Get-TwoFer
|
15
|
+
|
16
|
+
Will return: One for you, one for me
|
17
|
+
|
18
|
+
.EXAMPLE
|
19
|
+
Get-TwoFer -Name Alice
|
20
|
+
|
21
|
+
Will return: One for Alice, one for me
|
22
|
+
#>
|
2
23
|
[CmdletBinding()]
|
3
24
|
Param(
|
4
25
|
[Parameter(Mandatory=$false, Position=0)]
|
@@ -1,4 +1,25 @@
|
|
1
1
|
Function Get-TwoFer(){
|
2
|
+
<#
|
3
|
+
.SYNOPSIS
|
4
|
+
"Two-fer" is short for two for one. One for you and one for me.
|
5
|
+
|
6
|
+
.DESCRIPTION
|
7
|
+
If the given name is "Alice", the result should be "One for Alice, one for me."
|
8
|
+
If no name is given, the result should be "One for you, one for me."
|
9
|
+
|
10
|
+
.PARAMETER Name
|
11
|
+
The name to use.
|
12
|
+
|
13
|
+
.EXAMPLE
|
14
|
+
Get-TwoFer
|
15
|
+
|
16
|
+
Will return: One for you, one for me
|
17
|
+
|
18
|
+
.EXAMPLE
|
19
|
+
Get-TwoFer -Name Alice
|
20
|
+
|
21
|
+
Will return: One for Alice, one for me
|
22
|
+
#>
|
2
23
|
[CmdletBinding()]
|
3
24
|
Param(
|
4
25
|
[Parameter(Mandatory=$true, Position=0)]
|
data/tracks/rust/config.json
CHANGED
@@ -417,6 +417,8 @@
|
|
417
417
|
{
|
418
418
|
"slug": "crypto-square",
|
419
419
|
"uuid": "0cc485e9-43ba-4d97-a622-ee4cb8b9f1f7",
|
420
|
+
"core": false,
|
421
|
+
"unlocked_by": null,
|
420
422
|
"difficulty": 4,
|
421
423
|
"topics": [
|
422
424
|
"arrays",
|
@@ -1003,12 +1005,20 @@
|
|
1003
1005
|
{
|
1004
1006
|
"slug": "nucleotide-codons",
|
1005
1007
|
"uuid": "8dae8f4d-368d-477d-907e-bf746921bfbf",
|
1008
|
+
"core": false,
|
1009
|
+
"unlocked_by": null,
|
1010
|
+
"difficulty": 0,
|
1011
|
+
"topics": null,
|
1006
1012
|
"deprecated": true
|
1007
1013
|
},
|
1008
1014
|
{
|
1009
1015
|
"slug": "hexadecimal",
|
1010
1016
|
"uuid": "496fd79f-1678-4aa2-8110-c32c6aaf545e",
|
1017
|
+
"core": false,
|
1018
|
+
"unlocked_by": null,
|
1019
|
+
"difficulty": 0,
|
1020
|
+
"topics": null,
|
1011
1021
|
"deprecated": true
|
1012
1022
|
}
|
1013
1023
|
]
|
1014
|
-
}
|
1024
|
+
}
|
@@ -1,59 +1,65 @@
|
|
1
1
|
{
|
2
|
+
"docs_url": "",
|
2
3
|
"maintainers": [
|
3
4
|
{
|
4
|
-
"alumnus": false,
|
5
|
-
"avatar_url": null,
|
6
|
-
"bio": null,
|
7
5
|
"github_username": "IanWhitney",
|
6
|
+
"alumnus": false,
|
7
|
+
"show_on_website": false,
|
8
|
+
"name": null,
|
8
9
|
"link_text": null,
|
9
10
|
"link_url": null,
|
10
|
-
"
|
11
|
-
"
|
11
|
+
"avatar_url": null,
|
12
|
+
"bio": null
|
12
13
|
},
|
13
14
|
{
|
14
|
-
"alumnus": true,
|
15
15
|
"github_username": "etrepum",
|
16
|
-
"
|
16
|
+
"alumnus": true,
|
17
|
+
"show_on_website": false,
|
18
|
+
"name": null,
|
19
|
+
"link_text": null,
|
20
|
+
"link_url": null,
|
21
|
+
"avatar_url": null,
|
22
|
+
"bio": null
|
17
23
|
},
|
18
24
|
{
|
19
|
-
"alumnus": false,
|
20
|
-
"avatar_url": null,
|
21
|
-
"bio": null,
|
22
25
|
"github_username": "ijanos",
|
26
|
+
"alumnus": false,
|
27
|
+
"show_on_website": false,
|
28
|
+
"name": null,
|
23
29
|
"link_text": null,
|
24
30
|
"link_url": null,
|
25
|
-
"
|
26
|
-
"
|
31
|
+
"avatar_url": null,
|
32
|
+
"bio": null
|
27
33
|
},
|
28
34
|
{
|
29
|
-
"alumnus": false,
|
30
|
-
"avatar_url": null,
|
31
|
-
"bio": null,
|
32
35
|
"github_username": "petertseng",
|
36
|
+
"alumnus": false,
|
37
|
+
"show_on_website": false,
|
38
|
+
"name": null,
|
33
39
|
"link_text": null,
|
34
40
|
"link_url": null,
|
35
|
-
"
|
36
|
-
"
|
41
|
+
"avatar_url": null,
|
42
|
+
"bio": null
|
37
43
|
},
|
38
44
|
{
|
39
|
-
"alumnus": false,
|
40
|
-
"avatar_url": null,
|
41
|
-
"bio": null,
|
42
45
|
"github_username": "EduardoBautista",
|
46
|
+
"alumnus": false,
|
47
|
+
"show_on_website": false,
|
48
|
+
"name": null,
|
43
49
|
"link_text": null,
|
44
50
|
"link_url": null,
|
45
|
-
"
|
46
|
-
"
|
51
|
+
"avatar_url": null,
|
52
|
+
"bio": null
|
47
53
|
},
|
48
54
|
{
|
49
|
-
"alumnus": false,
|
50
|
-
"avatar_url": null,
|
51
|
-
"bio": null,
|
52
55
|
"github_username": "coriolinus",
|
56
|
+
"alumnus": false,
|
57
|
+
"show_on_website": false,
|
58
|
+
"name": null,
|
53
59
|
"link_text": null,
|
54
60
|
"link_url": null,
|
55
|
-
"
|
56
|
-
"
|
61
|
+
"avatar_url": null,
|
62
|
+
"bio": null
|
57
63
|
}
|
58
64
|
]
|
59
|
-
}
|
65
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.1.
|
4
|
+
version: 2.2.1.170
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -612,6 +612,18 @@ files:
|
|
612
612
|
- tracks/ballerina/docs/LEARNING.md
|
613
613
|
- tracks/ballerina/docs/RESOURCES.md
|
614
614
|
- tracks/ballerina/docs/TESTS.md
|
615
|
+
- tracks/ballerina/exercises/.ballerina/.gitignore
|
616
|
+
- tracks/ballerina/exercises/hello-world-service/.meta/reference/hello_world_service.bal
|
617
|
+
- tracks/ballerina/exercises/hello-world-service/hello_world_service.bal
|
618
|
+
- tracks/ballerina/exercises/hello-world-service/hello_world_service.client.out
|
619
|
+
- tracks/ballerina/exercises/hello-world-service/hello_world_service.description
|
620
|
+
- tracks/ballerina/exercises/hello-world-service/hello_world_service.server.out
|
621
|
+
- tracks/ballerina/exercises/hello-world-service/tests/hello_world_service_test.bal
|
622
|
+
- tracks/ballerina/exercises/hello-world/.meta/reference/hello_world.bal
|
623
|
+
- tracks/ballerina/exercises/hello-world/README.md
|
624
|
+
- tracks/ballerina/exercises/hello-world/hello_world.bal
|
625
|
+
- tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
|
626
|
+
- tracks/ballerina/exercises/run_ballerina_tests.sh
|
615
627
|
- tracks/ballerina/img/.keep
|
616
628
|
- tracks/bash/.git
|
617
629
|
- tracks/bash/.gitattributes
|