Strict
Import mojo
'-----------------------------------------------------------------
Class myClass Extends App
' Declare an 2D array
Field mA:Int[][]
'-----------------------------------------------------------------
Method OnCreate:Int()
SetUpdateRate 60
' Initialze the first dimension
mA = New Int[10][]
For Local x:Int = 0 To mA.Length()-1
' Initialize the second dimension
mA[x]= New Int[15]
For Local y:= 0 To mA[x].Length()-1
' Fill values into your array
mA[x][y] = x*y
Next
Next
Return 0
End
'-----------------------------------------------------------------
Method OnRender:Int()
Cls 155,0,0
For Local x:Int = 0 To mA.Length()-1
For Local y:= 0 To mA[x].Length()-1
DrawText mA[x][y], x*25+150, y*25+50, .5, .5
Next
Next
Return 0
End
End
'-----------------------------------------------------------------
Function Main:Int()
New myClass
Return 0
End