Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,12 @@
fibi is op n {
if n<2 then
n
else
x1:=0; x2:=1;
for i with tell (n - 1) do
x:=x1+x2;
x1:=x2;
x2:=x;
endfor;
x2
endif};

View file

@ -0,0 +1 @@
fibf is op n {1 pick ((n- 1) fold [1 pick, +] 0 1)};

View file

@ -0,0 +1 @@
fibf2 is 1 pick fold [1 pick, +] reverse (0 1 hitch) (-1+);

View file

@ -0,0 +1 @@
fibr is op n {fork [2>, +, + [fibr (-1 +), fibr (-2 +)]] n};

View file

@ -0,0 +1 @@
fibr2 is fork [2>, +, + [fibr2 (-1 +), fibr2 (-2 +)]];

View file

@ -0,0 +1 @@
fibm is op n {floor (0 1 pick (reduce ip (n reshape [2 2 reshape 1 1 1 0])))};

View file

@ -0,0 +1,5 @@
$ is reshape;
~ is tr f op a b {b f a}; % Goes before verb, rather than after like in J;
_ is floor; % Not really J, but J-ish? (Cannot redefine "<.".);
fibm2 is _(0 1 pick reduce ip([2 2$1 1 1 0](~$)));

View file

@ -0,0 +1 @@
fibm3 is op n {a:=2 2$1 1 1 0; _(0 1 pick ((n- 1) fold (a ip) a))};