Page 1 of 1

GE can't randomize 2D array

PostPosted: Fri Nov 26, 2010 9:46 am
by Bee-Ant
This for GE's developers..

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?

Re: GE can't randomize 2D array

PostPosted: Fri Nov 26, 2010 10:27 am
by lcl
Oh, I first thought you had written something wrong by accident but you're right, it doesn't work. :P