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,3 @@
import: parallel
: largeMinFactor dup mapParallel(#factors) zip maxFor(#[ second first ]) ;

View file

@ -0,0 +1,13 @@
import <Utilities/Conversion.sl>;
import <Utilities/Math.sl>;
import <Utilities/Sequence.sl>;
main(args(2)) :=
let
inputs := stringToInt(args);
factored := primeFactorization(inputs);
minFactors := vectorMin(factored);
indexOfMax := firstIndexOf(minFactors, vectorMax(minFactors));
in
"Number " ++ intToString(inputs[indexOfMax]) ++ " has largest minimal factor:\n" ++ delimit(intToString(factored[indexOfMax]), ' ');

View file

@ -0,0 +1 @@
factored := primeFactorization(inputs);

View file

@ -0,0 +1,5 @@
var nums = [1275792312878611, 12345678915808973,
1578070919762253, 14700694496703910,];
var factors = nums.map {|n| prime_factors.ffork(n) }.map { .wait }
say ((nums ~Z factors)->max_by {|m| m[1][0] })