Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,15 @@
function a(k, x1, x2, x3, x4, x5) {
function b() {
k -= 1;
return a(k, b, x1, x2, x3, x4);
}
return (k > 0) ? b() : x4() + x5();
}
// this uses lambda wrappers around the numeric arguments
function x(n) {
return function () {
return n;
};
}
alert(a(10, x(1), x(-1), x(-1), x(1), x(0)));

View file

@ -0,0 +1,6 @@
var x = n => () => n;
var a = (k, x1, x2, x3, x4, x5) => {
var b = () => a(--k, b, x1, x2, x3, x4); //decrement k before use
return (k > 0) ? b() : x4() + x5();
};