June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,20 @@
import extensions.
import system'collections.
F = (:n)((n == 0) ifTrue:[^1] ifFalse:[ ^n - (M(F(n-1))) ] ).
M = (:n)((n == 0) ifTrue:[^0] ifFalse:[ ^n - (F(M(n-1))) ] ).
program =
[
var ra := ArrayList new.
var rb := ArrayList new.
0 to:19 do(:i)
[
ra append(F eval:i).
rb append(M eval:i).
].
console printLine(ra).
console printLine(rb).
].

View file

@ -0,0 +1,17 @@
female_seq := proc(n)
if (n = 0) then
return 1;
else
return n - male_seq(female_seq(n-1));
end if;
end proc;
male_seq := proc(n)
if (n = 0) then
return 0;
else
return n - female_seq(male_seq(n-1));
end if;
end proc;
seq(female_seq(i), i=0..10);
seq(male_seq(i), i=0..10);