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,21 @@
class Array {
method gnomesort {
var (i=1, j=2);
var len = self.len;
while (i < len) {
if (self[i-1] <= self[i]) {
(i, j) = (j, j+1);
}
else {
self[i-1, i] = self[i, i-1];
if (--i == 0) {
(i, j) = (j, j+1);
}
}
}
return self;
}
}
var ary = [7,6,5,9,8,4,3,1,2,0];
say ary.gnomesort;