2023-07-01 11:58:00 -04:00
|
|
|
set fibs to {}
|
|
|
|
|
set x to (text returned of (display dialog "What fibbonaci number do you want?" default answer "3"))
|
|
|
|
|
set x to x as integer
|
|
|
|
|
repeat with y from 1 to x
|
2026-04-30 12:34:36 -04:00
|
|
|
if (y = 1 or y = 2) then
|
|
|
|
|
copy 1 to the end of fibs
|
|
|
|
|
else
|
|
|
|
|
copy ((item (y - 1) of fibs) + (item (y - 2) of fibs)) to the end of fibs
|
|
|
|
|
end if
|
2023-07-01 11:58:00 -04:00
|
|
|
end repeat
|
|
|
|
|
return item x of fibs
|