Arrays are declared similarly to variables. Arrays of all primitive types, except for mutex, may be created.
Arrays of all primitive types except for mutexes are allowed.
Multidimensional arrays may be achieved via objects.
# Declare array "xArr", size 5
int xArr 5;
# Declare array "xArr", size 5, and initialize all values to 0
int xArr 5 = 0;
int size = 10;
int secondArr size;
# Declare array "lArr", size 5
long lArr 5;
# Declare array "lArr", size 5, and initialize all values to 0
long lArr 5 = 0;
int size = 10;
long secondArr size;
# Declare array "dArr", size 5
double dArr 5;
# Declare array "dArr", size 5, and initialize all values to 0.0
double dArr 5 = 0.0;
int size = 10;
double secondArr size;
# Declare array "sArr", size 5
string sArr 5;
# Declare array "sArr", size 5, and initialize all values to ""
string sArr 5 = "";
int size = 10;
string secondArr size;
# Declare array "oArr", size 5
object oArr 5;
int size = 10;
object secondArr size;
# Declare array "xArr", size 5
int xArr 5;
int size = 10;
int secondArr size;
xArr[1] = 10;
secondArr[0] = 1;
int i = xArr[1];
int n = xArr[secondArr[0]];
# Declare array "dArr", size 5
double dArr 5;
int size = 10;
double secondArr size;
dArr[1] = 10.0;
secondArr[0] = 1.0;
double d = dArr[1];
double b = dArr[secondArr[0]];
# Declare array "sArr", size 5
string sArr 5;
int size = 10;
string secondArr size;
sArr[1] = "10";
secondArr[0] = "1";
string s = sArr[1];
string t = sArr[secondArr[0]];
Two-dimensional arrays may be created using objects.
object maze 5;
int index = 0;
while index < 5;
int maze[index].x 5;
int initIndex = 0;
while initIndex < 5;
maze[index].x[initIndex] = initIndex + 1;
initIndex += 1;
end;
index += 1;
end;
index = 0;
while index < 5;
int innerIndex = 0;
while innerIndex < 5;
print maze[index].x[innerIndex];
innerIndex += 1;
end;
println " ";
index += 1;
end;