-
Lua编程示例(五): C语言对Lua表的读取和添加
具体代码如下:#include "stdafx.h" lua_State *L; void load_lua(char *filename){ L=luaL_newstate(); luaL_op...
kavin 2018.05.19 2675浏览 0 -
Lua编程示例(四):Lua标准库之表库、字符串库、系统库
具体代码如下:tb1 = { "alpha","log","gamme"} print(table.concat(tb1," , ")) print(...
kavin 2018.05.19 2519浏览 0 -
Lua编程示例(三):稀疏表、双端队列、格式化输出、表和循环表的格式化输出
具体脚本如下:a={} for i=1,10 do a[i]={} for j=0,10 do if(i%2==0) then a[i][j]=0 end &nbs...
kavin 2018.05.19 2363浏览 0 -
Lua编程示例(二):面向对象、metatable对表进行扩展
具体代码如下: counter = { count = 0 } function counter.get(self) return self.count end function...
kavin 2018.05.19 2352浏览 0 -
Lua编程示例(一):select、debug、可变参数、table操作、error
具体代码如下:function test_print(...) for i=1,select("#",...) do print(i,select(i,...)) end end test...
kavin 2018.05.19 2541浏览 0