Creating arrays with more than one dimension in Monkey is a little tricky. We can create a function that lets us set up a 2D array, using the following steps:
Create2DArray
to the treasurechest.monkey
file. Its parameters are the number of cells required for both the dimensions. The return type is a 2D array of the type INT.Function Create2DArray:Int[][]( columns:Int, rows:Int)
Local a:Int[][] = New Int[columns][]
0
to columns
.For Local c:Int = 0 Until columns
a[c] = New Int[rows]
Next Return a End
3.16.139.8