add src-space lua

This commit is contained in:
yenru0 committed 2025-05-08 02:23:11 +09:00
1 parent d5aa0556a0
commit 07924bed36
4 files changed
+25

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
CC = luac
SRC_DIR = ./src
TARGET = main.lua
BUILD_DIR = ../../build
build:
${CC} -o ${BUILD_DIR}/lua.luac ${SRC_DIR}/${TARGET}
run: build
lua ${BUILD_DIR}/lua.luac
+11
View File
@@ -0,0 +1,11 @@
local function fib(n)
if n == 0 or n == 1 then
return n
else
return fib(n - 1) + fib(n - 2)
end
end
local n = io.read("*n")
print(fib(n))