I was trying to make my own version of minesweeper for TI 84 Plus CE, and I was working on the mine randomization loop, but for some reason, it was exiting the loop before the For( loop had reached its end value.
The code looked a little like this
Code:
Now, let's say I wanted 50 mines, I would test it out, and the loop would exit before A even reaches 10. I want to know why this might be as I'm very confused as to why this would happen.
PS, I know that the way I wrote things isn't ideal in the slightest, I have moved on to a different method that's far better, but I still want to know why this didn't work.
The code looked a little like this
Code:
For(A,1,M)
Lbl 1
"M is mine count"
randInt(1,S*T)→B
"S and T are the board dimensions"
If ʟMINE(B)=9
Then
"ʟMINE is the list where the state of the board is stored, and 9 signifies a mine"
Goto 1
Else
9→ʟMINE(B)
End
End
Now, let's say I wanted 50 mines, I would test it out, and the loop would exit before A even reaches 10. I want to know why this might be as I'm very confused as to why this would happen.
PS, I know that the way I wrote things isn't ideal in the slightest, I have moved on to a different method that's far better, but I still want to know why this didn't work.