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,28 @@
var str ="17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1"
const FractalProgram = str.split(',').map{.to_r} #=> array of rationals
func runner(n, callback) {
var num = 2.rat
n.times {
callback(num *= FractalProgram.find { |f| (f*num).de.is_one })
}
}
func prime_generator(n, callback) {
var x = 0;
runner(Math.inf, { |num|
var l = num.to_f.log2
if (l.floor == l) {
callback(l.to_i)
++x == n && return
}
})
}
STDOUT.autoflush(true)
runner(20, {|n| print (n, ' ') })
print "\n"
prime_generator(20, {|n| print (n, ' ') })
print "\n"