2022-05-15 20:40:20 +00:00
|
|
|
# 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
|
2022-05-15 20:40:20 +00:00
|
|
|
print_number(a)
|
2022-05-15 16:46:16 +00:00
|
|
|
set i to 0
|
2022-05-15 20:40:20 +00:00
|
|
|
while i < (n-1) do
|
|
|
|
set _a to a
|
2022-05-15 16:46:16 +00:00
|
|
|
set a to a+b
|
2022-05-15 20:40:20 +00:00
|
|
|
set b to _a
|
|
|
|
print_number(a)
|
|
|
|
set i to i+1
|
2022-05-15 16:46:16 +00:00
|
|
|
end
|