Advertisement
Velinquish

Lua's Fibonacci Sequence

Apr 14th, 2020
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.12 KB | None | 0 0
  1. local function F(n)
  2.     if n == 1 then
  3.         return 0
  4.     elseif n == 2 then
  5.         return 1
  6.     end
  7.     return F(n - 1) + F(n - 2)
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement