é误已ç»åçå¾ææ¾äº
ä½ ä½¿ç¨äºä¸ä¸ªç©ºå¼æ¥ç´¢å¼ä¸ä¸ªtable
æ¯å¦ ä½ è¿è¡ä¸ä¸è¿æ®µä»£ç ä½ å°±æäº
tab = {}
tab.size = {}
print(tab.size.a)
tab.size = nil
print(tab.size.a)
第ä¸æ¬¡è¾åºnil
第äºæ¬¡å°±åºç°äºåä½ ä¸æ ·çé误
å 为size æ¬èº«ä¸æ¯ä¸ä¸ªtable èä½ ä»¥è®¿é®tableçæ¹å¼æ¥è®¿é®è¿ä¸ªå¼ä¸ºnilçsize
æ以就åºç°è¿ä¸ªé®é¢äº
解å³çæ¹æ³æ¯ ä½ ç¡®è®¤ä¸ä¸ å¨ä¹åçå½æ°éæ¯å¦åå§åäºè¿ä¸ªsize æè
æ¯ æå®ç½®æniläº
追é®æ¯è¾å¥æªçæ¯ï¼é误çä½ç½®æ¯åºå®çï¼æè°æ´äºé¿åº¦ä¾ç¶è¿æ ·ï¼ææ½åºæ¥ä¸æ®µ
fruit_left_sur[3] = {}
for i = 0, 4 do
fruit_left_sur[3][i] = Mt.Surface.New("res/kiwi/left/"..i+1)
end
fruit_right_sur[3] = {}
for i = 0, 4 do
fruit_right_sur[3][i] = Mt.Surface.New("res/kiwi/right/"..i+1)
end
追çluaçæ°ç» é»è®¤æ¯ä»1å¼å§
ä½ ççæ¯ä¸æ¯è¿ä¸ªåå å¼èµ·ç
æ¯å¦
a = {"a","b","c"}
print(a[1])