RosettaCodeData/Task/Loops-Nested/TI-89-BASIC/loops-nested.basic

23 lines
419 B
Plaintext

Prgm
Local mat,i,j
© randMat(5, 5) exists but returns -9 to 9 rather than 1 to 20
newMat(5, 5) → mat
For i,1,rowDim(mat)
For j,1,colDim(mat)
rand(20) → mat[i,j]
EndFor
EndFor
Disp mat
Pause "Press a key."
ClrIO
For i,1,rowDim(mat)
For j,1,colDim(mat)
If mat[i,j] = 20 Then
Stop
Else
Output i*8, j*18, mat[i,j]
EndIf
EndFor
EndFor
EndPrgm