Texas Instruments ( TI-84 Plus)(calculator) scripting

Learn or Teach General Knowledge Related to Coding or Hacking

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Texas Instruments ( TI-84 Plus)(calculator) scripting

Postby SpeedWing » Wed Jun 24, 2009 1:38 am

Hello everyone,
I want to teach you guys a simple script with the calculator.

What does it do?
If you press the button "window" you will see a list with some variables, maybe you know if you change the window bounds to example 2000, the Xmin, Xmax, Ymin and Ymax.

the scanlines in the graph will be so close together that they will form a line. that is what you do not want.

the standard graph has exactly 20 lines, that is what we want.

there are a few things you should know.

to get some stuff in your script you need to press these
    -to get Xscl, Yscl, Ymin, Ymax, Xmin, Xmax --> When you are at your script, Press Vars-->Window
    -to get the "->" to store a variable simply press the button called "sto>"
    -to get Pause , when you are at your script, press PRGM-->CTL-->Press 8
    -to get Stop, when you are at your script, press PRGM-->CTL-->Press F
    -to get Disp, when you are at your script, press PRGM-->I/O-->Press 3
    -to get DelVar, when you are at the script, press PRGM-->CTL-->Press G



Code: Select all
//we want to store the space between the lines before we change them, so we can show them after, I stored the Xscl in the Q and the Yscl in the R.
Xscl->Q
Yscl->R
//these 2 lines change the Xscl and the Yscl, the Xscl is the space between a scanline on the X axle. and you can probably guess that the Yscl is the space between a scanline on the Y axle, and because we want 20 lines, we will devide the difference between the Ymax and Ymin, and we will devive the difference between the Xmax and Xmin.
//Now we will change the values of Yscl and Xscl, by using the ->.
(Ymax-Ymin)/20->Yscl
(Xmax-Xmin)/20->Xscl
//Now we will store the new values of the Yscl and Xscl, I chose V for Xscl and W for Yscl.
Xscl->V
Yscl->W
//Now We will display the values before the change, We are going to use the function "Disp" to display the text and the values. to start a new line place a ","
//we stored the value of the Xscl before in Q, and Yscl in R.
Disp "BEFORE:", "Xscl:", Q, "Yscl:", R
//We don't want to display the values after directly, so we use a "Pause", you can add a message with the pause.
Pause "PRESS ENTER"
//now we display the values after.
Disp "AFTER:", "Xscl:", V, "Yscl:", W
//To erase the values from the variables we used(this means they will be erased from the memory, and their value will be 0), we use the "DelVar" function
DelVar Q
DelVar R
DelVar V
DelVar W
//to remove the program from the memory we place a stop
Stop


now this does not looks clean, so here is the script again. but without comments..

Code: Select all
Xscl->Q
Yscl->R
(Ymax-Ymin)/20->Yscl
(Xmax-Xmin)/20->Xscl
Xscl->V
Yscl->W
Disp "Before:", "Xscl:", Q, "Yscl:", R
Pause  "PRESS ENTER"
Disp "After:", "Xscl:", V, "Yscl:", W
DelVar Q
DelVar R
DelVar V
DelVar W
Stop


To show that it really works...
I will first set the window to standard at first, just so you can do the same.(if you have this calculator). Then i set Xmin= -12,8983E-19 , Xmax= 12,92843E-19 , Ymin= -0,9767 , Ymax= 0,8237

ill calculate them too on my own
the Xscl will be (12,92843E-19+12,8983E-19)/20=1.2913365E-19
the Yscl will be (0,8237+0,9767)/20=0.09002


now i am going to run my script.
The output:
Code: Select all
BEFORE:
Xscl:
                       1
Yscl:
                       1
PRESS ENTER
AFTER:
Xscl:
           1.2913365E-19
Yscl:
                  .09002
                    Done



and now there are 20 scanlines on the X Axle and 20 on the Y Axle.
User avatar
SpeedWing
Defragler
 
Posts: 2031
Joined: Tue Jan 01, 2008 1:00 am
Location: If there is a Will there is a Solution.

Postby SpeedWing » Thu Aug 13, 2009 6:06 pm

Age calculator
Might not that accurate ¿¿

Code: Select all
lBL 0
ClrHome
Disp "Year?"
Prompt A
Disp "Month?"
Prompt B
If B<1 or B>12
Goto B
Disp "Day?"
Prompt C
Goto 1

Lbl B
ClrHome
Disp :"Enter a valid","month"
Pause
Goto 0

Lbl 1
If B=1
31->G
If B=2
Goto G
Lbl 2
If B=3
31->G
If B=4
30->G
If B=5
31->G
If B=6
30->G
If B=7
31->G
If B=8
31->G
If B=9
30->G
If B=10
31->G
If B=11
30->G
If B=12
31->G
Goto 3

Lbl G
If A=2008 or 2012 or 2016 or 2020
1->H

If H=1
29->G

If H≠1
28->G

Goto 2

Lbl 3

If C<1 or C>G
Goto C

Goto 4

Lbl C
ClrHome
Disp "Enter a valid","day"
Pause
Goto 0

Lbl 4
ClrHome
Disp "Loading...."
getDate->L1
If A>L1(2)
Goto D

If A=>L1(1) and B>L1(2)
Goto D

If A=L1(1) and B=L1(2) and C>L1(30
Goto D

Goto 5

Lbl D
ClrHome
Disp "Enter a date in","the past"
Pause
Goto 0

Lbl 5
getDate->L1
L1(1)-A ->D
L1(2)-B ->E
L1(3)-C ->F

If E<0
D-1 ->D
If E<0
12+E ->E

If F<0
E-1 ->E
If F<0
G=F ->F

If L1(2)=B and C>L1(3)
D-1 ->D
If L1(2)=B and C>L1(3)
12+E ->E

Lbl 6
ClrHome
Menu("Output?","Year+Month+Day",N,"In days",Z

Lbl N
ClrHome
Disp "Years:"
Disp D
Disp "Months:"
Disp E
Disp "Days:"
Disp F
Goto 7

Lbl Z
E*365 ->I
E*30 ->J
I+J+D ->K
ClrHome
Disp "Days:"
Disp K

Lb 7
DelVar A
DelVar B
DelVar C
DelVar D
DelVar E
DelVar F
DelVar G
DelVar H
DelVar I
DelVar J
DelVar K
ClrList L1



the output will look like this

Code: Select all
Year?
A=?1992
Month?
B=?9
Day?
C=?30

now a menu comes up
Code: Select all
OUTPUT?
1: Year+Month+Day
2: In days


if your choose Year+Month+day

Code: Select all
Years:
_________16
Months:
_________10
Days:
_________13
Done


if you choose In days

Code: Select all
Days:
_________6156
Done



If you enter a not existing month or day, a message will appear that you've got to enter a valid month or day
User avatar
SpeedWing
Defragler
 
Posts: 2031
Joined: Tue Jan 01, 2008 1:00 am
Location: If there is a Will there is a Solution.

Postby g3nuin3 » Fri Oct 16, 2009 10:22 am

Hey in the past i played around with the TEXAS instruments emulatr and you could actually write code for it, im not entirely sure how i went as it was a very long time ago but it was fun, cool to see someone else plays with calculators, especially the TI's theyre the shit.

edit: i beliee it was here : http://www.ticalc.org/
g3nuin3
Acker
 
Posts: 96
Joined: Tue Jul 18, 2006 10:53 am

Re: Texas Instruments ( TI-84 Plus)(calculator) scripting

Postby SpeedWing » Wed Oct 26, 2016 6:40 am

Hello everyone!

I might try to launch my TI 84 again!

Let's see what I can understand and learn you these days :!: :?:
User avatar
SpeedWing
Defragler
 
Posts: 2031
Joined: Tue Jan 01, 2008 1:00 am
Location: If there is a Will there is a Solution.


Return to Knowledge Base

Who is online

Users browsing this forum: No registered users and 0 guests