三维数组赋值小例程
int uu = 0, vv = 0, ww = 0;
for (j = y - 30; j >= 20; j-=10)
{
if (j == y-110||(y-20-j)%90==0)
{
vv = 0;ww = 0;z = zz + 1;uu = z;
goto bb;
}
for (i = 20; i < x - 20; i+=10)
{
if (i >= 180)
{
if ((i - 20) == 160||(i - 10 ) % 170 == 0){uu++;ww = 0; goto aa;}
}
g.DrawRectangle(w, i, j, 10, 10);
kld[uu, vv, ww] = i; //三维数组赋值完毕;i为长,j为宽
kld2[uu, vv, ww] = j;
ww++;
aa: ;
}
zz = uu;
uu=z;ww = 0;vv++;
bb: ;
}
该程序主要用于画方形地图时,构建坐标和画方格的。