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,25 @@
class Vector(x, y, z) {
method ∙(vec) {
[self{:x,:y,:z}] »*« [vec{:x,:y,:z}] «+»;
}
method ⨉(vec) {
Vector(self.y*vec.z - self.z*vec.y,
self.z*vec.x - self.x*vec.z,
self.x*vec.y - self.y*vec.x);
}
method to_s {
"(#{x}, #{y}, #{z})";
}
}
var a = Vector(3, 4, 5);
var b = Vector(4, 3, 5);
var c = Vector(-5, -12, -13);
say "a=#{a}; b=#{b}; c=#{c};";
say "a ∙ b = #{a ∙ b}";
say "a ⨉ b = #{a ⨉ b}";
say "a ∙ (b ⨉ c) = #{a ∙ (b ⨉ c)}";
say "a ⨉ (b ⨉ c) = #{a ⨉ (b ⨉ c)}";