Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -0,0 +1,13 @@
a k x1 x2 x3 x4 x5:
local b:
set :k -- k
a k @b @x1 @x2 @x3 @x4
if <= k 0:
+ x4 x5
else:
b
local x i:
labda:
i
!. a 10 x 1 x -1 x -1 x 1 x 0

View file

@ -0,0 +1,8 @@
def a; a = { k, x1, x2, x3, x4, x5 ->
def b; b = {
a (--k, b, x1, x2, x3, x4)
}
k <= 0 ? x4() + x5() : b()
}
def x = { n -> { it -> n } }

View file

@ -0,0 +1 @@
println (a(10, x(1), x(-1), x(-1), x(1), x(0)))

View file

@ -0,0 +1,3 @@
(0..20).each { k ->
printf ("%3d: %7d\n", k, a(k, x(1), x(-1), x(-1), x(1), x(0)))
}