~GaLs~
† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
- Reaction score
- 180
Two dimensional arrays in vJass, since vJass is implemented on top of Jass, are just normal arrays in disguise, using a multiplication trick to convert 2-dimension indexes into a one-dimension one. The way to declare one of these arrays is: <type> array name[width][height], notice the real size of the array is width*height, this size suffers the same limitations as normal array's size, it cannot go above approximately 40800, and if this size is bigger than 8191, you will be using slower function calls instead of array lookups and multiple arrays in the final script, etc.
Declaration : <type> array name[width][height]
Let say, I have a 2D array var:
And, I was told that the arrays are just normal arrays in disguise, using a multiplication trick to convert 2-dimension indexes into a one-dimension one.
And, the real size of the array is width*height.
So, int[1][2] = int[2][1]?
Since 1x2 = 2, and 2x1 = 2...