langatator/examples/fibo.ltor

14 lines
209 B
Text
Raw Normal View History

# print the 20 first fibonacci numbers
set n to 20
set a to 0
2022-05-15 16:46:16 +00:00
set b to 1
print_number(a)
2022-05-15 16:46:16 +00:00
set i to 0
while i < (n-1) do
set _a to a
2022-05-15 16:46:16 +00:00
set a to a+b
set b to _a
print_number(a)
set i to i+1
2022-05-15 16:46:16 +00:00
end