RosettaCodeData/Task/Create-a-two-dimensional-array-at-runtime/BASIC/create-a-two-dimensional-array-at-runtime-11.basic
2020-02-17 23:21:07 -08:00

6 lines
415 B
Text

10 INPUT "Size? ";rows;"*";columns
20 DIM a(rows,columns): REM defines a numeric array
30 LET a=INT (RND*rows)+1: LET c=INT (RND*columns+1): REM the array is labelled a, but the letter a is still available for variable assignment
40 LET a(a,c)=1
50 PRINT a(a,c)
60 DIM a(1): REM arrays cannot be removed without CLEARing the entire variable space, but redimensioning them to 1 will save most of the space they used