I created a Jagged array
public int[,,] npcState = new int[,,] {
{
{0,0}
},{
{1,9,1},{1,0,1},{1,1,1}
},{
{2,2,2},{1,1,1},{1,1,1}
},{
{1,1,1},{10,10}
},{
{8,0},{0,0},{0,0},{0,0}
},{
{10,7},{1,1,1},{1,1,1},{1,1,1},{1,1,1}
},{
{2,2,2}
},{
{1,1,1} ,{1,1,1}
},{
{8,11},{0,0},{0,0},{0,0},{0,0}
},{
{0,1,1},{1,1,1}
}
};
My questions are
1.)How to assign value at run time , if i declare like
public int[,,] npcWayPoints;
2.)How to assign each rows and colomns at run time
3.)How to check array each rows and column using loop like
for(int i =0 ; i < firstDimensionalLength ; i ++){
for(int j =0 ; j < secondDimensionalLength; j ++){
for(int k =0 ; k < thirdDimensionalLength; k ++){
print (npcState[i,j,k]);
}
}
}
If it constant length for all dimensional , it is easy to find elements . But if it dynamic how to find each elements in particular positions.