/* fibonacci */ /* F_0 = 0 */ /* F_1 = 1 */ /* F_n = F_{n-1} + F_{n-2} */ struct a b c end; method fib(x) if x < 0 then return x; end; a := 0; if x < 1 then return x; end; b := 1; if x < 2 then return x; end; var t := this; while not (x < 2) do t.c := t.a-(0-t.b); t := t--8; x := x-1; end; return (t-8).c; end;