basictexas-instruments

TI-84 BASIC: Nested For Loops via matrix iteration


I am new to TI-84 BASIC programming and having a devil of a time at it. Right now I am trying to write a function that will sum a matrix but my for loops only run once. I do see in the manual that for loops can be nested, but I haven't been able to find a working example.

This is what I have. I store the row/column length in R/C respectively then use those values to iterate through the matrix.

dim([A])→L₆
L₆(1)→R
L₆(2)→C

0→N

For(X,1,R,1)
For(Y,1,C,1)
[A](X,Y)+N→N
Disp X
Disp Y
END
END

Disp N

Output:

1
1
4 ([A](1 , 1)==4)
Done

I am able to confirm that R and C do get the values that they need, still I have tried replacing R and C with 3 just to try to force the loop to work. Any idea as to what I am doing wrong?


Solution

  • The issue was that I was using END when I should have been using End.

    Note for new TI-84 programmers: if you include extra white-space (other than newlines) or have a syntax error, you won't be warned; your program will just poop out.