This commit is contained in:
Annie
2025-05-06 17:34:00 -04:00
parent 8bba742c99
commit 0a5b6ee7fb
3 changed files with 22 additions and 11 deletions

View File

@ -6,26 +6,34 @@ function entry : string2integer
function Fib : integer2integer
Fib(i) := {
[ Boolean: a ; Boolean: b ; Boolean: c]
if( i = 0 ) then {
[integer: a; integer: b ; Boolean: d ; integer: c]
(*if( i = 0 ) then {
return 7;
} else {
i := i;
}
}*)
(*b := b | (a & c);
b := 2 < 3;*)
if(i = 1) then {
i := printCharacter('a');
return 1;
} else {
return i + Fib(i - 1);
(* `if(i = 1) then { return 1; } else {
return Fib(i - 1) + Fib(i - 2);
}
*)
a := 0;
b := 1;
while(0 < i) {
c := a + b;
a := b;
b := c;
}
return c;
}
entry (arg) := {
[ integer: x; integer: y ]
x := 2;
x := Fib(2);
y := printInteger(Fib(2));
(* x := Fib(2);*)
y := printInteger(Fib(3));
return 1;
}