For i = 1 To maxI
For j = 1 To maxJ
x = (i - 1) * size
y = (j - 1) * size
GraphicsWindow.FillRectangle(x, y, size, size)
cell[one][i][j] = "White"
EndFor
EndFor
GraphicsWindow.MouseDown = OnMouseDown
Sub OnMouseDown
If (started = "True") then
Program.End()
EndIf
x = GraphicsWindow.MouseX
y = GraphicsWindow.MouseY
ix = Math.Ceiling(x / size)
iy = Math.Ceiling(y / size)
If (ix > maxI) Then
Goto start
EndIf
If (iy > maxJ) Then
Goto start
EndIf
If (cell[one][ix][iy] = "White") Then
cell[one][ix][iy] = "Black"
GraphicsWindow.BrushColor = "Black"
Else
cell[one][ix][iy] = "White"
GraphicsWindow.BrushColor = "White"
EndIf