• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

体验Lua

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

想用之和NGINX结合,终结公司混乱的NGINX配置

玩起来先,感觉很精简,很实用哟。

print("hello world")
a={1,2}
b=a
print(a==b,a~=b)
a=1
b="abc"
c={}
d=print
print(_VERSION)
print(type(a))
print(type(b))
print(type(c))
print(type(d))
a="single 'quote' string and double \"quoteed\"string inside"
c=[[ multiem line
with 'single'
and "double" inside.]]
print (c)
a,b,c,d,e = 1, 2, "three", "four", 5, 6
print (a,b,c,d,e )
a, b = b, a
print ("a="..a,"b="..b,c,d,e )
print "hahahaha"
io.write("hehehe")
a={}
b={1, 2, 3}
c={"a", "b", "c"}
print (a, b, c)
address={}
address.Street = "Wyman street"
address.StreetNumber = 360
print(address.StreetNumber)
a = 1
if a == 1 then
    print("a is one")
else
    print("a is not on")
end

a = 1
while a ~= 5 do
    a = a + 1
    io.write(a.." ")
end
a = 0
repeat
    a = a + 1
    print(a)
until a == 5

for a = 1, 4 do io.write(a) end
print()
for a = 1, 6, 3 do io.write(a) end
for xm_key, xm_value in pairs({1, 3, 5, 7}) do print(xm_key, xm_value) end

a = 0
while true do
    a = a + 1
    if a == 10 then
        break
    end
end
print(a)

function myFunc(a, b, c)
    return a, b, c, "hello more", 1, true
end

a, b, c, d, e, f = myFunc(1, 2, "three")
print(a, b, c, d, e, f)

function printf(fmt, ...)
    io.write(string.format(fmt, ...))
end

printf("hello %s from %s on %s\n",
    os.getenv"USER" or "there", _VERSION, os.date())


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
如何更好的学习Lua第二篇,基本语法发布时间:2022-07-22
下一篇:
基于CClosure实现lua访问C++对象成员发布时间:2022-07-22
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap