Coding Through the Alphabet - Fibonacci in Lua
Lua is a lightweight, high-level, multi-paradigm scripting language designed primarily for embedded use in applications. It is widely used in game development.
How to test
Prerequisites: Lua
- Ubuntu/Debian:
sudo apt install lua5.4 - macOS:
brew install lua
lua fibonacci.lua
Expected output:
0
1
1
2
3
5
8
13
21
34
Source Code
local a, b = 0, 1
for _ = 1, 10 do
print(a)
a, b = b, a + b
end
Local Testing Screenshot
