[問題]二維陣列中的動態陣列
如下:
//*** 後是問題所在,感謝!
var game=new Array();
var total=4;
var a1=[1,2];
var a2=[1,2,3,4];
var a3=[1,2,3,4,5,6];
var a4=[1,2,3,4,5,6,7,8];
var kk=[a1.length,a2.length,a3.length,a4.length]
for(var i=0;i<total;i++)
{
game[i]=new Array(kk[i])
for(var ii=0;ii<kk[i];ii++)
{
game[i][ii]=a4[ii]; //**** a4的位置 希望是 "a"+i 的動態陣列 代表a1~a4
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.33.150.182
推
05/28 23:28, , 1F
05/28 23:28, 1F
→
05/28 23:39, , 2F
05/28 23:39, 2F
→
05/28 23:40, , 3F
05/28 23:40, 3F
推
05/28 23:44, , 4F
05/28 23:44, 4F
→
05/28 23:45, , 5F
05/28 23:45, 5F
→
05/28 23:46, , 6F
05/28 23:46, 6F
→
05/28 23:46, , 7F
05/28 23:46, 7F
→
05/28 23:47, , 8F
05/28 23:47, 8F
推
05/29 00:22, , 9F
05/29 00:22, 9F
→
05/29 00:23, , 10F
05/29 00:23, 10F
推
05/29 00:30, , 11F
05/29 00:30, 11F
→
05/29 00:31, , 12F
05/29 00:31, 12F
→
05/29 00:32, , 13F
05/29 00:32, 13F
→
05/29 00:33, , 14F
05/29 00:33, 14F
→
05/29 00:33, , 15F
05/29 00:33, 15F
→
05/29 00:34, , 16F
05/29 00:34, 16F
→
05/29 00:35, , 17F
05/29 00:35, 17F
→
05/29 00:35, , 18F
05/29 00:35, 18F
→
05/29 00:35, , 19F
05/29 00:35, 19F
→
05/29 11:02, , 20F
05/29 11:02, 20F
Flash 近期熱門文章
PTT數位生活區 即時熱門文章