7.2.5 Multi-dimensional Arrays

The use of array-indexing is not restricted to one dimension. CSI(C&F) provides rectangular multi-dimensional arrays. The following program stores the settings on a chess-board:

FOR row = 1 TO 8 STEP 1

FOR column = 1 TO 8 STEP 1

PRINT "Figure on position ["

PRINT row PRINT "," PRINT column

PRINT "] is : "

INPUT Board[row][column]

PRINT "You entered "

PRINT Board[row][column] PRINT CR

NEXT column

NEXT row

Beside the use of the multi-dimensional array Board[8][8] we encountered the INPUT statement. This statement can be used to get variables values from the console. Numerical values are typed in their conventional form like

Figure on position [1,1] is : 10

You entered 10

The input of strings has to be enclosed by double-quotes:

Figure on position [1,2] is : "King"

You entered King