我的 lua 代码中有以下功能。我收到一个错误Attempt to call field 'insert' (a nil value)
我有上面的主要块
local cardDeck;
local suits = {"h","d","c","s"};
然后在功能
function createDeck()
cardDeck = {};
for i=1, 4 do
for j=1, 13 do
local tempCard = suits[i]..j;--PRINT SHOW VALID VALUE HERE i.e. "h1","d2" etc
table.insert(cardDeck,tempCard); --THIS LINE IS ERROR
end
end
end