GE can't randomize 2D array
Posted: Fri Nov 26, 2010 9:46 am
This for GE's developers..
Make some arrays in Global code first...for example:
Then type this in any Script Editor:
Why the first line give an error while the second line not?
Why we can't randomize array 2D index DIRECTLY, while we can in 1D array?
Make some arrays in Global code first...for example:
- Code: Select all
int Array2D[6][5]=
{
0,1,2,3,4,
5,6,7,8,9,
10,11,12,13,14,
15,16,17,18,19,
20,21,22,23,24,
};
int Array1D[6]=
{
0,1,2,3,4,
};
Then type this in any Script Editor:
- Code: Select all
int i=Array2D[rand(5)][rand(5)];
int j=Array1D[rand(5)];
Why the first line give an error while the second line not?
Why we can't randomize array 2D index DIRECTLY, while we can in 1D array?