Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,16 @@
func middle_three(n) {
var l = n.len;
if (l < 3) {
"#{n} is too short"
} elsif (l.is_even) {
"#{n} has an even number of digits"
} else {
"The three middle digits of #{n} are: " + n.digits.ft(l-3 / 2, l/2 + 1).join
}
}
var nums = %n(
123 12345 1234567 987654321 10001 -10001 -123 -100 100 -12345
1 2 -1 -10 2002 -2002 0
);
nums.each { say middle_three(_) };