I am writing Mine Sweeper for the Ti 84 CE in basic. I am currently improving the version I had written entirely on the calculator itself and so far I've made it much faster via better algorithms. The one thing I can't seem to figure out is how to draw squares fast. My old method was to draw 9 lines, but I found that this took awhile. I then discovered that Pt-On commands were pretty fast at drawing pixels with the drawback that they have a limited amount of shapes.
(Using a window of X:0,264 Y:0,-164)
Current Method for drawing a 9x9 square:
For(J,4,4,1)
Line(D-4,C+J,D+4,C+J,ORANGE,1)
End
This is what I found to be the fastest for a 7x7 square, one of them draws a 7x7 square with a 3x3 hole in the middle, the other draws a 3x3 square to fill the hole. It seems to be faster than drawing lines:
Pt-On(X,Y,1,ORANGE)
Pt-On(X,Y,2,ORANGE)
The fastest I could come up with for a 9x9 square involved 5 steps:
Pt-On(X-1,Y-1,2,ORANGE)
Pt-On(X+1,Y+1,2,ORANGE)
Pt-On(X-1,Y+1,1,ORANGE)
Pt-On(X+1,Y-1,1,ORANGE)
Pxl-On(Y,X,ORANGE)
It is a bit slow, and I am unsure if it is faster than drawing 9 lines. Is there a faster way to do this? (I plan to create the whole game in pure Ti Basic)
Here are the steps in action along with the 3 special shapes that can be drawn with Pt-On
(Using a window of X:0,264 Y:0,-164)
Current Method for drawing a 9x9 square:
For(J,4,4,1)
Line(D-4,C+J,D+4,C+J,ORANGE,1)
End
This is what I found to be the fastest for a 7x7 square, one of them draws a 7x7 square with a 3x3 hole in the middle, the other draws a 3x3 square to fill the hole. It seems to be faster than drawing lines:
Pt-On(X,Y,1,ORANGE)
Pt-On(X,Y,2,ORANGE)
The fastest I could come up with for a 9x9 square involved 5 steps:
Pt-On(X-1,Y-1,2,ORANGE)
Pt-On(X+1,Y+1,2,ORANGE)
Pt-On(X-1,Y+1,1,ORANGE)
Pt-On(X+1,Y-1,1,ORANGE)
Pxl-On(Y,X,ORANGE)
It is a bit slow, and I am unsure if it is faster than drawing 9 lines. Is there a faster way to do this? (I plan to create the whole game in pure Ti Basic)
Here are the steps in action along with the 3 special shapes that can be drawn with Pt-On