function test_print(...)
for i=1,select("#",...) do
print(i,select(i,...))
end
end
test_print(11,12,13,14)
print()
print(debug.traceback())
print()
function test(...)
for i=1,arg.n do
print(i.."\t"..arg[i])
end
end
test("a",2,34,234)
print()
g={}
table.insert(g,{
name="Clairs",
level = 70,
})
table.insert(g,{
name="SEGA",
level = 35,
})
table.insert(g,{
name="Millber",
level = 50,
})
function myprint()
for i,v in ipairs(g) do
print(i,v["level"],v.name)
end
end
myprint()
function comp(a,b)
return a.levelb.level
end
table.sort(g,comp)
print()
myprint()
print()
function foo(str)
if type(str) ~= "string" then
error("string error!",2)
end
end
--foo({x =1 })
tb1={ "asdf","bate","game",one="heihei"}
table.insert(tb1,3,"haha")
table.remove(tb1,2)
for i,v in ipairs(tb1) do
print(v)
end
print(#tb1)