Archived
1
0
Fork 0
This repository has been archived on 2023-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
SLOTH/examples/fibs.sl

21 lines
260 B
Text

% program to generate list of the first N fibs
N := input;
a := 0;
b := 1;
f := 1;
print f; % print out the first one
while N > 1 do
begin
% update vars
f := a + b;
a := b;
b := f;
N := N - 1;
print f; % print the next fib
end
% all done!