摘要:
tbl = {"alpha", "beta", ["one"] = "uno", ["two"] = "dos"}for key, value in ipairs(tbl) do print(key, value)end 阅读全文
posted @ 2014-03-05 18:05
yufenghou
阅读(248)
评论(0)
推荐(0)
摘要:
x=10local i=1while i20 then local x x =20 print(x+2)else print(x)endprint(x) 阅读全文
posted @ 2014-03-05 17:42
yufenghou
阅读(155)
评论(0)
推荐(0)
摘要:
print(type("hello"))print(type(print))--[[给一个全局变量付一个nil数值可以删除这个变量]]--print("10"+1)days={"1","2","3","4","5","6","7"}print(days[4]) 阅读全文
posted @ 2014-03-05 17:21
yufenghou
阅读(111)
评论(0)
推荐(0)
摘要:
function fact(n) if n==0 then return 1 else return n*fact(n-1) endendprint("输入一个数")a=io.read("*number")print(fact(a)) 阅读全文
posted @ 2014-03-05 16:18
yufenghou
阅读(218)
评论(0)
推荐(0)

浙公网安备 33010602011771号