Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何访问Lua中表的第一个元素?_Lua - Fatal编程技术网

如何访问Lua中表的第一个元素?

如何访问Lua中表的第一个元素?,lua,Lua,我想访问我创建的表的第n个元素,如下所示: t = { 0.0 , 0.0 } 我怎么能在卢阿做到这一点 我知道我可以使用ipairs,但我希望使用单行解决方案。索引是基于1的: t[n] 第一个要素是: t[1]

我想访问我创建的表的第n个元素,如下所示:

t = { 0.0 , 0.0 }
我怎么能在卢阿做到这一点

我知道我可以使用ipairs,但我希望使用单行解决方案。

索引是基于1的:

t[n]
第一个要素是:

t[1]