1.什么是table? table是Lua最复杂最强大的数据结构,Lua本身并不是面向对象语言,但是对面向对象中毒比较深的程序员,可以借助table”完美”地模拟面向对象编程.最简单地,我们可以把table理解为数组,最复杂的,我们可以把table理解为”世间万物”,因为它可以创造出很多你想象不到的东西.一个字,自由度非常大~! 2.如何创建一个table? local a = {} 或者 local a = {["x"] = 12, ["mutou"] = 99,…
table.maxn (table) Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices. (To do its job this function does a linear traversal of the whole table.) 返回表中最大的正数值index. 说明: 1. 此接口不是统计表中元素的…
days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"} will initialize days[1] with the string "Sunday" (the first element has always index 1, n…