# make
Please do 'make PLATFORM' where PLATFORM is one of these:
aix ansi bsd freebsd generic linux macosx mingw posix solaris
See doc/readme.html for complete instructions.
安装:make linux install
#
# cd ..
#
# ls
hello.lua sec.lua
#
# lua hello.lua
Hello World!
#
# cat hello.lua
print("Hello World!")
#
# cat sec.lua
function fact(n)
if n == 0 then
return 1
else
return n*fact(n-1)
end
end
print("enter a num")
a=io.read("*number")
print(fact(a))
#
# lua sec.lua
enter a num
1
1
参考中文手册:http://www.codingnow.com/2000/download/lua_manual.html
Please do 'make PLATFORM' where PLATFORM is one of these:
aix ansi bsd freebsd generic linux macosx mingw posix solaris
See doc/readme.html for complete instructions.
安装:make linux install
#
# cd ..
#
# ls
hello.lua sec.lua
#
# lua hello.lua
Hello World!
#
# cat hello.lua
print("Hello World!")
#
# cat sec.lua
function fact(n)
if n == 0 then
return 1
else
return n*fact(n-1)
end
end
print("enter a num")
a=io.read("*number")
print(fact(a))
#
# lua sec.lua
enter a num
1
1
参考中文手册:http://www.codingnow.com/2000/download/lua_manual.html