[ Go to Stephen's Entry Page ]

[ TI Book front page |    TI Resources Page |   PC99 Review |   PC99 Programs ]

Contact contact - please use subject="pc99 page" to avoid spam trap!

This page contains program lists for TI99/4a.

Web article Four- published May 1999


In an earlier article I demonstrated the various graphics utilities you can use with the TI99/4a, and you can refer back to that if you do not have The Missing Link which is referenced below for several programs.
You can use Windows cut and paste to enter the text into PC99 into a runnable program.
HOW A TWO YEAR OLD
CAN TYPE AT 20 W.P.M.

FAST TYPER...
1 REM SILLY PROG BY S SHAW
MARCH 1991
2 ! did you see COMPUTER WAR
S-the film? It is said that
the star, who was requir
ed to type fast into a comp
uter
3 ! could not type, so a pro
gram just like this one was
used to give a good effect!
4 ! now adjust it how you wi
sh and show your friends how
fast you can type
5 ! at end of text string pr
ogram will just stop with th
is listing but can be modifi
ed to do anything you wish!
6 !
100 A$="This is how a non-ty
pist canproduce information
on screen quickly, with
out "
110 A$=A$&"having to look a
t what keys are being bashed
! Just bash keys and watch h
ow perfect text appears no
matter what you press"
120 PRINT A$: : : : : :
130 CALL KEY(5,A,B):: IF B<1
THEN 130
140 C=C+1 :: PRINT SEG$(A$,C
,1);:: IF C=LEN(A$)THEN 160
150 GOTO 130
160 GOTO 160

=============================


1 ! ADDING FRACTIONS
2 ! result is not reduced
eg 12/16 would usually
be shown as 3/4
100 CALL CLEAR
110 DISPLAY AT(10,5):"--- +
--- = ---"
120 ACCEPT AT(9,5)SIZE(3)VAL
IDATE(DIGIT):A
130 ACCEPT AT(11,5)VALIDATE(
DIGIT)SIZE(3):B
140 ACCEPT AT(9,11)SIZE(3)VA
LIDATE(DIGIT):C
150 ACCEPT AT(11,11)SIZE(3)V
ALIDATE(DIGIT):D
160 GOSUB 230
170 DISPLAY AT(9,16):USING "
####":N
180 DISPLAY AT(11,16):USING
"####":L
190 DISPLAY AT(14,1):"ENTER
KEY FOR ANOTHER"
200 DISPLAY AT(1,1):"NORMAL
RESULT=";A/B+C/D
210 ACCEPT AT(24,12):A$ :: GOTO 100
220 STOP
230 FOR X=2 TO B*D
240 IF INT(X/B)<X/B THEN 260
250 IF INT(X/D)=X/D THEN 270
260 NEXT X
270 L=X
280 N=INT(L/B)*A+INT(L/D)*C
290 RETURN

Now write a program which will reduce the answer to a more normal format- and also one which can take away as well as add. This is not a trivial test! and I will list a suitable program later- see if you can do it first!
===================================

PI

PI is the ratio of a circles radius (distance from centre to edge) and its circumference (distance all the way round).

In Extended Basic we have a fixed variable PI we can use. In TI Basic we can use the function ATN to derive PI. In machine code or most other languages we are on our own! WE could approximate to 3.14, but if greater accuracy is required? This little program derives PI to as many places as our language can support, without using any trigonometry, and is quite remarkably fast!
You may note the use of AND 2, which is using AND as a "logical operator", not too well covered in the manual. In Extended Basic, type in:
FOR T=1 TO 20 :: PRINT T;T AND 2 :: NEXT T and inspect the result!!!

1 ! CALCULATE PI
2 ! QUICKLY AND ACCURATELY
3 ! from W F DOSSETT,
AUSTIN, TEXAS,
25 feb 88
4 ! for ti99/4a s shaw 3/91
5 ! from John Machin, 1706
6 !
7 ! n=7 for 13 digit accuracy of ti99/4a basic
8 ! n>7 if language goes beyond 13 digits!
9 ! eg n=35 for 53 digits
10 !
100 N=7 :: K=-1
110 K=K+1
120 I=-((2 AND 2*K)-1)
130 U=U+4*I/((2*K+1)*5^(2*K+1))
140 V=V+I/((2*K+1)*239^(2*K+1))
150 IF K<=N THEN 110
160 W=U-V :: PI2=4*W
170 ! DONE
180 PRINT PI2,PI
190 PRINT (PI2-PI)*1000,! COMPARE with on board variable
200 PRINT (PI2-(4*ATN(1)))*1000 ! compare with TI Basic's calculation
210 PRINT " ";(PI2-3.14)*100;:: DISPLAY AT(24,2)SIZE(4):"3.14" ! displays ALL the digits actually in the variable!!!=13 incl dec point.
220 PRINT " 3.14159265358979 -etc" ! more accurate actual value for comparison!
230 END
999 !from THE REC NEWSLETTER March 1988 Vol 3 #2

The program is not derived from the standard mathematical series, stretching off to infinity, but from an approximation published around 1706, a little before computers were around! This -courtesy of Mr Dossett- has yielded a rather fast program!
=========================

PRIMES...

Continuing with math related topics, prime numbers- that is numbers which are divisible only by themselves and 1. Asked to write a program to list prime numbers I suspect most of us would start from 1 and then try dividing every number by every number to see if it was divisible...

The first listing is fsirly straight forward, but uses a few tricks to speed things up. In particular, if we know that a number is NOT divisible by two, it cannot possibly be divisible by any higher power of two, such as 4- or indeed any multiple of two. So we can check just the odd numbers, and also not bother testing for divisors greater than the first power of a known prime.

100 ! FIRST 100 PRIMES -NEATLY-
110 ! from Loren Krienke via THE REC NEWSLETTER March 1988 Vol 3 #2
120 ! for ti99/4a s shaw
130 L=100 ! number required
140 DIM P(100)! P(L)-holds found primes, used as divisors
150 DIM S(100)! S(L)-squares of primes, reduces number of divisions needed
160 P(1)=2 ! first prime
170 PRINT P(1);
180 T=1 ! initialise loop
190 FOR I=2 TO L ! test non-even numbers:
200 T=T+2
210 FOR J=1 TO I-1
220 CALL MOD(T,P(J),R):: IF R=0 THEN 200
230 IF T>S(J)THEN 235 ELSE 240
235 NEXT J
240 P(I)=T ! found prime, store it
250 S(I)=T*T ! GREATER SPEED
260 PRINT T;!PRIME
270 NEXT I ! LOOP
280 !
290 ! 18 JUly 1986
300 ! Loren Krienke
310 ! San Diego, Ca.
320 !
330 SUB MOD(A,B,C)! C=A MOD B becomes CALL MOD(A,B,C)
340 C=INT(A-B*INT(A/B))
350 SUBEND

A similar but very much more opaque program follows, which has no obvious connection with the above, but it produces the same output!!! Check out the speed comparison between the two programs. Any difference?

You may also wish to try looking for a larger number of primes!

100 ! FIRST 100 PRIMES -QUICKLY-
110 ! Dr H B Phillps from THE REC NEWSLETTER March 1988 Vol 3 #2
120 DIM P(300),X(12)
130 A=0 :: B=1 :: D=0.5 :: E=180
140 M=100 :: L=3 :: F=0
150 ! increase M for more- also increase DIMs.
160 PRINT 2;:: C=B :: IF M=B THEN END
170 L=INT((M/C)*L+F):: N=L+L+B
180 FOR I=B TO INT((SQR(N)-B
)*D):: PP=P(I)
190 IF PP=B THEN 230
200 IF PP=A THEN PP=I+I+B ::
PRINT PP;:: P(I)=PP :: C=C+
B :: IF C=M THEN END
210 IF X(I)=A THEN X(I)=(PP*PP-B)*D
220 FOR J=X(I)TO L STEP PP :
: P(J)=B :: NEXT J :: X(I)=J
230 NEXT I :: IF F=0 THEN S=I
240 FOR I=S TO L
250 IF P(I)=A THEN PP=I+I+B :: PRINT PP;:: P(I)=PP :: C=C+B :: IF C=M THEN END
260 NEXT I :: F=(M-C)*L/E :: S=L+B
270 GOTO 170

And no, I have no idea how this program works! When faced with a problem, the programmer usually has more than one way of attacking it, and it also usually happens that by restating the problem a faster solution can be found.

============================

The Missing Link as a disk image for emulators. ||   The Missing Link Manual from WH Tech.

Now for a graphic program requiring The Missing Link.

100 ! RABBITS AND FOXES
110 ! Dolores Garcia,Spain
120 ! Dr M Ecker, PA, USA
130 ! s shaw for ti99/4a ex bas+tml april 91
140 CALL LINK("CLEAR"):: A,B=5
150 CALL LINK("PRINT",A,B,"Rabbits and Foxes"):: A=A+12 :: B=5
160 CALL LINK("PRINT",A,B,"Please input the variables requested below. Suggested
values are given for a 'typical' response. Try others!")
170 CALL LINK("PRINT",70,12,"RABBIT BIRTH RATE:")
180 CALL LINK("PRINT",80,12,"RABBIT DEATH RATE (Excl eaten ones!):")
190 CALL LINK("PRINT",100,12,"RATE OF EATEN RABBITS:")
200 CALL LINK("PRINT",110,12,"FOXES DEATH RATE:")
210 CALL LINK("PRINT",120,12,"FOXES BIRTH RATE:")
220 CALL LINK("INPUT",70,150,A,4,".04"):: IF A<0.00001 THEN A=0.4
230 CALL LINK("INPUT",90,150,B,6,".00005"):: IF B<1E-9 THEN B=.0005
240 CALL LINK("INPUT",100,150,C,4,".002"):: IF C<0.00001 THEN C=.002
250 CALL LINK("INPUT",110,150,D,4,".03"):: IF D<0.00001 THEN D=.04
260 CALL LINK("INPUT",120,150,E,5,".0002"):: IF E<1E-8 THEN E=.0002
270 CALL LINK("PRINT",140,12,"RABBITS START AT:")
280 CALL LINK("PRINT",150,12,"FOXES START AT:")
290 CALL LINK("INPUT",140,120,R,4,"300")
300 CALL LINK("INPUT",150,120,F,4,"30")
310 CALL LINK("CLEAR")
320 P=F*R
330 R=(1+A-B*R)*R-C*P
340 F=(1-D)*F+E*P
350 P=F*R
360 IF ER>500 THEN CALL LINK(180,180,"-.-.-."):: GOTO 360
370 IF NOT(F>0 AND R>0 AND F<200 AND R<640)THEN ER=ER+1 :: GOTO 330
380 CALL LINK("PIXEL",2+4*F,R*.7+2):: CALL LINK("PRINT",181,1,"RABBITS:"&STR$(INT(R))&" ")
390 CALL LINK("PRINT",181,110,"FOXES:"&STR$(INT(F))&" ")
400 ER=0
410 GOTO 330
420 END

=============================

This is a tricky little program - for The Missing Link, in this format it is a demo program, but if you leave the worm invisible all the time (by leaving Pen Erase on all the time) then you have a nasty little trick - especially if you disable break and quit. This is the fun version...

100 A,B=10
110 CALL LINK("PRINT",A,B,"The Missing Link is a disk based utility which allows the Extended Basic programmer to make use of many ")
120 CALL LINK("PRINT",A,B,"enhanced commands, including true bit map graphics, w hich in turn allows more powerful PRINT commands, and of ")
130 CALL LINK("PRINT",A,B,"course, full access to sprites.")
140 CALL LINK("PRINT",A,B,"This program demonstrates graphics outside a small window which, worm fashion, eat up the text! Enjoy..")
150 ! WORM
160 ! SCIENTIFIC AMERICAN DEC 87 by S L Wentworth
170 ! TI99/4A BY S SHAW 91
180 ! EXT BAS + THE MISSING LINK
190 DIM XC(25),YC(25)
200 XC(2),YC(2),XC(1),YC(1)=100
210 D=0
220 T=1
230 RANDOMIZE
240 CALL LINK("WINDOW",80,80
,110,120,1)
250 CALL LINK("PRINT",7,7,"WORM HOLE")
260 CALL LINK("REVWIN")
270 WT=T
280 CALL MOD(T,25,T):: T=T+1
290 CALL LINK("PE")
300 CALL LINK("CIRCLE",XC(T)
,YC(T),4,0)
310 CALL LINK("PD")
320 C=RND
330 IF C<.5 THEN D=D+.1745 ELSE D=D-.1745
340 X=XC(WT)
350 Y=YC(WT)
360 NX=X+4*COS(D)
370 NY=Y+4*SIN(D)
380 IF NX>189 THEN NX=NX-189
390 IF NY>240 THEN NY=NY-240
400 IF NX<2 THEN NX=NX+189
410 IF NY<1 THEN NY=NY+240
420 XC(T)=NX
430 YC(T)=NY
440 !
450 CALL LINK("CIRCLE",NX,NY
,4,0)
460 CALL LINK("PD")
470 GOTO 270
480 SUB MOD(A,B,C)
490 C=INT(A-B*INT(A/B)
) 500 SUBEND



================================

This is the promised fractional plus and minus program. I won't tell you how long it took me to get the displays like that....

100 ! FRACTIONAL + AND -
110 ! R CALDWELL JAN 91
120 ! FOR TI99/4A BY
130 ! S SHAW APR 91
140 DIM Q(102)
150 DISPLAY AT(1,1)ERASE ALL
:"FRACTIONAL + & -"
160 DISPLAY AT(7,1):"-------"
170 DE,X=1
180 ACCEPT AT(6,2)VALIDATE(D
IGIT,"+-")SIZE(4):N(X)
190 IF N(X)=0 THEN 310
200 ACCEPT AT(8,2)VALIDATE(D
IGIT)SIZE(4):D(X)
210 IF D(X)=0 THEN 310
220 DP(X)=N(X):: DE=DE*D(X)
230 CALL HCHAR(6,1,32,12)
240 CALL HCHAR(8,1,32,12)
250 DISPLAY AT(5,1):"PLUS:"
260 DISPLAY AT(3,1):"ENTER 0 TO TOTAL"
270 X=X+1 :: DISPLAY AT(7,15
):"ITEM";X :: DISPLAY AT(8,1
5):"-MAX 10-"
280 IF X=11 THEN 310
290 GOTO 180
300 REM
310 F,X=X-1
320 FOR S=1 TO F :: FOR J=1 TO F
330 Z=Z+1 :: K=S+J-1
340 P(S,J)=K-F*INT(K/F):: IF P(S,J)=0 THEN P(S,J)=F
350 Q(Z)=P(S,J):: NEXT J :: NEXT S
360 FOR X=1 TO F :: Y=F*X-F+1 :: FOR C=1 TO F-1
370 Y=Y+1 :: DP(X)=DP(X)*D(Q(Y)):: NEXT C
380 NU=NU+DP(X):: NEXT X :: DD=2
390 DISPLAY AT(10,1):"SUM IS
:" :: DISPLAY AT(11,5):NU;"/
";DE
400 IF NU/DD=INT(NU/DD)AND D
E/DD=INT(DE/DD)THEN NU=NU/DD
:: DE=DE/DD:: GOTO 400
410 DD=DD+2+(DD=2)
420 IF ABS(NU)>DE THEN A=ABS(NU)ELSE A=DE
430 IF DD<=SQR(A)THEN 400
440 IF NU/DE=INT(NU/DE)THEN 540
450 IF NU>0 THEN WN=INT(NU/DE):: NU=NU-WN*DE :: PN=1
460 IF NU<0 THEN WN=INT(NU/DE)+1 :: NU=ABS(NU-WN*DE):: PN=2 :: IF WN=0 THEN NU=-NU
470 REM
480 DISPLAY AT(13,5):USING "
#######":NU
490 IF PN=1 THEN DISPLAY AT(
14,1):WN :: NU=NU+WN*DE
500 IF PN=2 THEN DISPLAY AT(
14,1):WN :: IF WN<0 THEN NU=WN*DE-NU
510 PN=0
520 DISPLAY AT(14,5):"-------"
530 DISPLAY AT(15,5):USING "
#######":DE
540 DISPLAY AT(18,4):NU/DE
550 DISPLAY AT(24,4):"ANY KE
Y FOR ANOTHER"
560 CALL KEY(5,G,H):: IF H<1 THEN 560
570 RUN
580 END

=========================

CRYPTO CALC...

In this puzzle the computer will ask you to form a target number by using the four main math operators ( add, minus, divide, times) and some numbers it will give you. You may select the number of numbers you wish to use, the computer will select the numbers and the target, and then the computer will find the order of operations. You will probably beat the computer!

Let's say the target is 1 and the numbers are 10 10 6 and 8.
10/10=1 and 8-6=2 and then 2-1=1
The computer will display this in the form:
((8-6)-(10/10)) adding brackets to make the order of operations plainer.

From time to time, unusually! the computer may beat you to it or even find a solution you cannot - but it may be painfully slow! Can you speed this up?

100 CALL CLEAR :: RANDOMIZE
110 PRINT "CRYPTO CALC":"Ray McClanahan 1989":"for TI99/4A 1991 S Shaw":"":"based on Krypto by":"MBH Games Co"
120 PRINT "":"from REC Newsletter":" Vol 4 #7":""
130 !
140 !
150 PRINT "How many cards? 4-9": : : :
160 DISPLAY AT(23,9):"5" :: ACCEPT AT(23,9)SIZE(-1)VALIDATE("456789"):C :: W=C-1
170 !
180 V=INT(RND*C*5)+1 :: PRINT "":"TARGET VALUE CALCULATED"
190 F(1)=1 :: FOR A=2 TO C :: F(A)=A*F(A-1):: NEXT A
200 PRINT "Computer now selecting numbers to use..."
210 RANDOMIZE
220 FOR A=1 TO C
230 I(A)=INT((INT(RND*RND*C*
10+1)+INT(RND*C*4+1)+INT(RND
*RND*12+1))/3):: IF I(A)>C*5
THEN 230
240 IF I(A)=I(A-1)THEN I(A)=
I(A)+4 :: IF I(A)>25 THEN 230
250 PRINT I(A):: NEXT A
260 FOR A=1 TO 500 :: NEXT A :: CALL CLEAR
270 FOR U=1 TO F(C):: D=C :: J=U :: GOSUB 660
280 FOR A=1 TO C :: M(A)=I(R(A)):: NEXT A
290 FOR E=1 TO F(W):: D=W :: J=E :: GOSUB 660
300 DISPLAY AT(4,1):"TARGET VALUE:";V
310 DISPLAY AT(6,1):"Make th
is value using only + - * /
and these numbers:"
320 FOR A=1 TO C :: DISPLAY AT(A+8,24):I(A):: NEXT A
330 DISPLAY AT(16,1):"There MAY be no solution- computer will tell you..."
340 FOR A=1 TO W :: Q(A)=R(A):: NEXT A
350 FOR A=1 TO W :: Z(A)=1 :: NEXT A
360 FOR A=1 TO C :: N(A)=M(A):: NEXT A
370 FOR A=1 TO W :: P(A)=Q(A):: S(A)=Z(A):: NEXT A
380 FOR A=1 TO W :: L=C+1-A
390 ON S(P(A))GOTO 400,410,4
20,430
400 N(P(A))=N(P(A))+N(P(A)+1
):: GOTO 450
410 N(P(A))=N(P(A))-N(P(A)+1
):: GOTO 450
420 N(P(A))=N(P(A))*N(P(A)+1):: GOTO 450
430 IF N(P(A)+1)=0 THEN 570
440 N(P(A))=N(P(A))/N(P(A)+1)
450 IF A=W THEN 550
460 IF P(A)=L-1 THEN 510
470 FOR B=P(A)+1 TO L-1
480 N(B)=N(B+1):: NEXT B
490 FOR B=P(A)TO W-1
500 S(B)=S(B+1):: NEXT B
510 FOR B=A+1 TO W
520 IF P(A)>P(B)THEN 540
530 P(B)=P(B)-1
540 NEXT B
550 NEXT A
560 IF ABS(V-N(1))<0.001 THEN 760
570 FOR A=W TO 1 STEP -1
580 IF Z(A)=4 THEN 600
590 Z(A)=Z(A)+1 :: GOTO 650
600 Z(A)=1
610 NEXT A
620 DISPLAY AT(10,1):"OP Order Perm No";E;" failure" :: NEXT E
630 DISPLAY AT(12,1):"Number order Perm No";U;" failure" :: NEXT U
640 DISPLAY AT(14,1):"ALL PO
SSIBILITIES CHECKED":"NO MAT
CH" :: CALL SOUND(900,200,0)
:: RUN
650 GOTO 360
660 FOR H=1 TO D :: T(H)=H :: NEXT H
670 FOR X=1 TO D-1
680 Y=D-X
690 G=INT((J-1)/F(Y)+.00001)
700 R(X)=T(G+1)
710 J=J-G*F(Y)
720 IF G=Y THEN 740
730 FOR K=G+1 TO D-1 :: T(K)=T(K+1):: NEXT K
740 NEXT X
750 R(D)=T(1):: RETURN
760 FOR A=1 TO C :: O$(A)=STR$(M(A)):: NEXT A
770 FOR A=1 TO W :: P(A)=Q(A):: S(A)=Z(A):: NEXT A
780 FOR A=1 TO W :: L=C+1-A
790 ON S(P(A))GOTO 800,810,820,830
800 O$(P(A))="("&O$(P(A))&
"+"&O$(P(A)+1)&")" :: GOTO 840
810 O$(P(A))="("&O$(P(A))&
"-"&O$(P(A)+1)&")" :: GOTO 840
820 O$(P(A))="("&O$(P(A))&
"*"&O$(P(A)+1)&")" :: GOTO 840
830 O$(P(A))="("&O$(P(A))&
"/"&O$(P(A)+1)&")" :: GOTO 840
840 IF A=W THEN 940
850 IF P(A)=L-1 THEN 900
860 FOR B=P(A)+1 TO L-1
870 O$(B)=O$(B+1):: NEXT B
880 FOR B=P(A)TO W-1
890 S(B)=S(B+1):: NEXT B
900 FOR B=A+1 TO W
910 IF P(A)>P(B)THEN 930
920 P(B)=P(B)-1
930 NEXT B
940 NEXT A
950 PRINT O$(1)
960 DISPLAY AT(15,1):O$(1):"
":"ANY KEY FOR ANOTHER"
970 CALL KEY(5,A,B):: IF B<1 THEN 970
980 DISPLAY AT(12,2)ERASE A
LL:"ONE MOMENT..."
990 RUN
1000 END

==========================
This very long top-down program could be made shorter - can you do it? - and is a trick based upon Pascals Triangle.
Details of operation in the listing- if you like, try to think of it this way...

The computer first establishes rules which determine how it will deal with six numbers. These rules are fixed. A target result is set, you input two numbers, and based upon these the computer will forecast the other numbers you are going to input, and put in a balancing number itself- before you input your extra numbers!- in order to achieve the desired result.

It is an interesting puzzle....

10 ! math trick from REC NEWSLETTER Vol 4 #7 after Michael W Ecker from Prof H L Ridge
20 ! for ti99/4a by s shaw april 1991
40 PRINT "Math Trick":"S Shaw April 1991":""
100 REM
110 PRINT "We will first choose six numbers across the top of the screen"
120 PRINT "Then we will add up each pair of adjacent numbers."
130 PRINT "The result of this sum will be divided by five until only a remainder is left."
140 PRINT "This we will place below thepair we have added. We continue to do this untilonly one number is left."
150 PRINT "You will choose all the top numbers except one. Before you have chosen all your numbers I will tell you the final number."
160 PRINT "Aren't us computers clever!"
170 PRINT "":"press any key to start"
180 CALL KEY(5,A,B)
190 IF B<1 THEN 180
200 CALL CLEAR
210 PRINT "No, tell you what, YOU choose what that final number should
be: 0, 1, 2, 3, or 4:":
220 ACCEPT AT(24,26)SIZE(1)V
ALIDATE("01234"):A$ :: IF LE
N(A$)<1 THEN 220
230 TGT=VAL(A$)
240 CALL CLEAR
250 DISPLAY AT(1,1):"-- -- -
- -- -- --"
260 DISPLAY AT(23,1):"INPUT
ONE OR TWO DIGIT NUMBERS AS INDICATED ABOVE"
270 DISPLAY AT(20,1):"TARGET
=";A$
280 ACCEPT AT(1,1)SIZE(2)VAL
IDATE(DIGIT):N1
290 ACCEPT AT(1,10)SIZE(2)VA
LIDATE(DIGIT):N4
300 Z=N1
310 IF Z>5 THEN Z=Z-5 :: GOTO 310
320 N6=TGT-Z :: N6=N6+10*INT(RND*8+1)
330 DISPLAY AT(1,15):N6
340 ACCEPT AT(1,4)SIZE(2)VAL
IDATE(DIGIT):N2
350 ACCEPT AT(1,7)SIZE(2)VAL
IDATE(DIGIT):N3
360 ACCEPT AT(1,13)SIZE(2)VAL
IDATE(DIGIT):N5
362 CALL HCHAR(23,1,32,64)
370 DISPLAY AT(17,1):N1;"+";
N2;"=";N1+N2 :: Z=N1+N2
380 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
390 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N1=Z2*5
400 DISPLAY AT(2,2)BEEP:N1 :
: FOR T=1 TO 1900 :: NEXT T
410 DISPLAY AT(17,1):N2;"+";
N3;"=";N2+N3 :: Z=N2+N3
420 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
430 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N2=Z2*5
440 DISPLAY AT(2,5)BEEP:N2 :
: FOR T=1 TO 1900 :: NEXT T
441 !
442 !
450 DISPLAY AT(17,1):N3;"+";
N4;"=";N3+N4 :: Z=N3+N4
460 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
470 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N3=Z2*5
480 DISPLAY AT(2,8)BEEP:N3 :
: FOR T=1 TO 1900 :: NEXT T
481 !
482 !
490 DISPLAY AT(17,1):N4;"+";
N5;"=";N4+N5 :: Z=N4+N5
500 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
510 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N4=Z2*5
520 DISPLAY AT(2,11)BEEP:N4
:: FOR T=1 TO 1900 :: NEXT T
521 !
530 DISPLAY AT(17,1):N5;"+";
N6;"=";N5+N6 :: Z=N5+N6
540 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
550 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N5=Z2*5
560 DISPLAY AT(2,14)BEEP:N5
:: FOR T=1 TO 1900 :: NEXT Tv 561 !
570 DISPLAY AT(17,1):N1;"+";
N2;"=";N1+N2 :: Z=N1+N2
580 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
590 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N1=Z2*5
600 DISPLAY AT(3,3)BEEP:N1 :
: FOR T=1 TO 1900 :: NEXT T
610 DISPLAY AT(17,1):N2;"+";
N3;"=";N2+N3 :: Z=N2+N3
620 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
630 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N2=Z2*5
640 DISPLAY AT(3,6)BEEP:N2 :
: FOR T=1 TO 1900 :: NEXT T
650 DISPLAY AT(17,1):N3;"+";
N4;"=";N3+N4 :: Z=N3+N4
660 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
670 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N3=Z2*5
680 DISPLAY AT(3,9)BEEP:N3 :
: FOR T=1 TO 1900 :: NEXT T
690 DISPLAY AT(17,1):N4;"+";
N5;"=";N4+N5 :: Z=N4+N5
700 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
710 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N4=Z2*5
720 DISPLAY AT(3,12)BEEP:N4
:: FOR T=1 TO 1900 :: NEXT T
721 !
730 DISPLAY AT(17,1):N1;"+";
N2;"=";N1+N2 :: Z=N1+N2
740 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
750 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N1=Z2*5
760 DISPLAY AT(4,5)BEEP:N1 :
: FOR T=1 TO 1900 :: NEXT T
761 !
770 DISPLAY AT(17,1):N2;"+";
N3;"=";N2+N3 :: Z=N2+N3
780 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
790 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N2=Z2*5
800 DISPLAY AT(4,8)BEEP:N2 :
: FOR T=1 TO 1900 :: NEXT T
801 !
810 DISPLAY AT(17,1):N3;"+";
N4;"=";N3+N4 :: Z=N3+N4
820 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
830 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N3=Z2*5
840 DISPLAY AT(4,11)BEEP:N3
:: FOR T=1 TO 1900 :: NEXT T
841 !
850 DISPLAY AT(17,1):N1;"+";
N2;"=";N1+N2 :: Z=N1+N2
860 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
870 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N1=Z2*5
880 DISPLAY AT(5,7)BEEP:N1 :
: FOR T=1 TO 900 :: NEXT T
881 !
890 DISPLAY AT(17,1):N2;"+";
N3;"=";N2+N3 :: Z=N2+N3
900 DISPLAY AT(18,1):Z;"/";5
;"=";Z/5 :: Z2=Z/5-INT(Z/5)
910 DISPLAY AT(19,1):Z2;"*";
5;"=";Z2*5 :: N2=Z2*5
920 DISPLAY AT(5,10)BEEP:N2
:: FOR T=1 TO 900 :: NEXT T
921 !
930 DISPLAY AT(17,1):N1;"+"
;N2;"=";N1+N2 :: Z=N1+N2
940 DISPLAY AT(18,1):Z;"/";
5;"=";Z/5 :: Z2=Z/5-INT(Z/5)
950 DISPLAY AT(19,1):Z2;"*"
;5;"=";Z2*5 :: N1=Z2*5
960 DISPLAY AT(6,9)BEEP:N1 :
: FOR T=1 TO 900 :: NEXT T
970 DISPLAY AT(6,9)BEEP:N1 :
: FOR T=1 TO 900 :: NEXT T
980 DISPLAY AT(9,1):"TARGET ACHIEVED"
990 DISPLAY AT(23,1):"ANY KEY TO DO IT AGAIN"
1000 CALL KEY(5,A,B)
1010 IF B<1 THEN 1000
1020 DISPLAY AT(12,3)ERASE A
LL:"ONE MOMENT..."
1030 RUN
1040 END

=======================



[ TI Book front page   |    TI Resources Page    |   PC99 Review    |   PC99 Programs ]

br>