add src-space lua

This commit is contained in:
2025-05-08 02:23:11 +09:00
parent d5aa0556a0
commit 07924bed36
4 changed files with 25 additions and 0 deletions

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

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))