現在、いくつかのテストを行っていますが、このコードの何が問題になっているのかわかりません。何か考えはありますか?
function IATetris(Pieza,Rotacion,Array)
io.write("The table the script received has: ",Pieza,"\n")
RotacionInicial = Rotacion
PosInicial = 7
final = #Array --this gets the size of the array
i = 1
for y = 1, 20 do --the array of my tetris board is 20 in x and 14 in y so it would be something like this Array2D[20][14]
io.write(" First for y ",y,"\n")
Array2D[y]={} --clearing the new array
for x = 1,14 do
io.write(" First for x ",x,"\n")
if i == final then break end
io.write(" First for i",i,"\n")
Array2D[y][x] = Array[i]
i= i+1 --seems like you cant use i++ in lua
end
end
end
私がやっていることは、2つの整数と1つの配列を取得することです。プログラムが実際にどこに向かっているのかを確認するためにコンソールに書き込む必要があります。取得しているのは...
最初のログメッセージ:"The table the script received has: "
および2番目のログメッセージ:" First for y "
しかし、私はそれ以上のことはしていませんので、おそらくプログラムはそこでクラッシュしていますか?この関数は約20秒ごとに呼び出されています。なぜこれが起こっているのか私には本当にわかりません。どんな助けでも本当にありがたいです、ありがとう。