Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
widget:
|
3 |
+
- text: "-- This function calculates the nth Fibonacci number iteratively. The Fibonacci sequence is a series
|
4 |
+
-- of numbers where the next number is found by adding up the two numbers before it.
|
5 |
+
-- For example, the sequence starting with 0 and 1 is: 0, 1, 1, 2, 3, 5, 8, 13, ....
|
6 |
+
function fibonacci(n)
|
7 |
+
local a, b = 0, 1
|
8 |
+
for i = 1, n do
|
9 |
+
a, b = b, a+b
|
10 |
+
end
|
11 |
+
return a
|
12 |
+
end"
|
13 |
+
---
|