blocks = {block1 = {}, block2 = {}}
blocks.block1.x = 1
blocks.block1.y = 2
blocks.block2.x = 3
blocks.block2.y = 4
我想打印块表x
中y
的每个项目,比如
for b in blocks do
print(b.x)
print(b.y)
end
我知道块以这种方式最终成为局部变量,但我不知道任何其他解释方式。
基本上我想要输出
>
1
2
3
4
>