RosettaCodeData/Task/Fibonacci-sequence/AppleScript/fibonacci-sequence-2.applescript

10 lines
131 B
AppleScript
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
on fib(n)
if n < 1 then
0
else if n < 3 then
1
else
fib(n - 2) + fib(n - 1)
end if
end fib