|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Displays random lines.
None
None
A, B, C
TI-83/84/+/SE
:ClrDraw
:ZStandard
:Delvar ADelvar B
:Repeat getKey
:randInt(Xmin,Xmax→C
:randInt(Ymin,Ymax
:Line(A,B,C,Ans
:Ans→B:C→A
:EndBefore we can start displaying random lines on the graph screen, we need to perform some basic setup. We then create two variables for the first (X,Y) coordinate by setting their initial values to zero. Once inside the Repeat loop, we randomly select the second (X,Y) coordinate for the line. (Please note we didn't need to store the second variable, since Ans is able to hold a numeric value, and it is also faster.)
Now that we have the two coordinates for the line figured out, we draw the line on the screen and store the first coordinate values to the second coordinate values, i.e., the second coordinate becomes the new first coordinate. This gets repeated over and over again until you press a key.
.