From: sklar@picasso.ocis.temple.edu (Dave Sklar)
Newsgroups: comp.sys.handhelds
Subject: Artillery for Ti-81
Date: 27 Sep 92 20:26:49 GMT
Organization: Temple University
X-Newsreader: Tin 1.1 PL5


TiTank
(c) 1991, David H. Sklar

[Note: "q" should be entered as Theta]
Listing 1: Ti-Tank Main Program

ClrHome
Disp "   WELCOME TO"
Disp "     TI-TANK"
Disp ""
Disp "TRACE (0/1)"
Input q
0->Yscl
2->Xres
2->Xmin
100->Xmax
2->Ymin
100->Ymax
5->Arow
5->Acol
-9.6->[A](5,1)
25->[A](6,2)
4->N
"MYsin X+.5[A](5,1)M2"->Y3
"MYcos X"->Y4
All-Off
Round(Rand*3+1,0)->T
If T=1
Prgm2
If T=2
Prgm3
If T=3
Prgm4
If T=4
Prgm5
Round(Rand*3+1,0)->E
Lbl 1
Round(Rand*3+1,0)->F
If E=F
Goto 1
[A](E,1)->R
[A](E,2)->S
R->K
S->L
0->O
Prgm6
[A](F,1)->P
[A](F,2)->Q
P->K
Q->L
1->O
Prgm6
Pause
Lbl5
DispHome
ClrHome
Disp "PLAYER 1"
Lbl T
Disp "ANGLE->"
AO->U
Disp U
Input A
If A=0
Goto T
A/abs A->O
abs A->A
Disp "POWER->"
B->U
Disp U
Input B
abs B->B
ClrHome
Disp "PLAYER 2"
Lbl U
Disp "ANGLE->"
CZ->U
Disp U
Input C
If C=0
Goto U
C/abs C->Z
abs C->C
Disp "POWER->"
D->U
Disp U
Input D
abs D->D
DispGraph
R->U
U->G
S->V
V->H
0->M
0->W
B->Y
A->X
Lbl 2
S+Y3->V
R+ZY4->U
If q=1
Line(G,H,U,V)
If q=0
PT-Chg(G,H)
U->X
If Y1>V
Goto 4
if Y2>V
Goto 4
If M>N
Prgm7
If W=0
Goto 9
PT-Chg(U,V)
M+[A](5,2)->M
If U>Xmax
Goto 4
If U<XMin
Goto 4
If V>2Ymax
Goto 4
If V<Ymin
Goto 4
U->G
V->H
Goto 2
Lbl 4
P->U
U->G
Q->V
V->H
0->M
0->W
D->Y
C->X
Lbl 6
Q+Y3->V
P+ZY4->U
If q=1
Line(G,H,U,V)
If q=0
PT-Chg(G,H)
U->X
If Y1>V
Goto 7
If Y2>V
Goto 7
If M>N
Prgm7
If W0
Goto 9
PT-Chg(U,V)
M+[A](5,2)->M
If U>Xmax
Goto 7
If U<Xmin
Goto 7
If V>2Ymax
Goto 7
If V<Ymin
Goto 7
U->G
V->H
Goto 6
Lbl 7
Pause
Goto 5
Lbl 9
Line(U,V,Xmax,Ymax)
Line(U,V,Xmin,Ymax)
Line(U,V,Xmax,Ymin)
Line(U,V,Xmin,Ymax)
Pause
DispHome
ClrHome
Disp "PLAYER"
If W=1
Disp "ONE"
If W=2
Disp "TWO"
Disp "WON!!!"
End
----------
Program 2: Terrain A

ClrDraw
"2+50cos X"->Y1
"2+50sin 12X"->Y2
Shade(Ymin,Y1,2)
Shade(Ymin,Y2,1)
6.211->[A](1,1)
47.895[A](2,1)
77.074->[A](3,1)
91.663->[A](4,1)
56->[A](1,2)
40.286->[A](2,2)
18.286->[A](3,2)
43.428->[A](4,2)
----------
Program 3: Terrain B

ClrDraw
"23+40(sin 3X)2"->Y1
"40"-> Y2
Shade(Ymin,Y2,2)
Shade(Ymin,Y1,1)
5.094->[A](1,1)
44->[A](1,2)
28.821->[A](2,1)
67.333->[A](2,2)
60.8->[A](3,1)
44->[A](3,2)
88.653->[A](4,1)
67.333->[A](4,2)
----------
Program 4: Terrain C

ClrDraw
".01(X-50)^2-10"->Y1
"2+43sin 6X"->Y2
Shade(Ymin,Y1,2)
Shade(Y1,Y2,1)
15.411[A](1,1)->
48.666->[A](1,2)
31.916->[A](2,1)
17.555->[A](2,2)
66.989->[A](3,1)
42.444->[A](3,2)
90.716->[A](4,1)
33.111->[A](4,2)

----------
Program 5: Terrain D

ClrDraw
".6X+5sin30X"->Y1
"X+10sin 60X"->Y2
Shade(Shade(Ymin,Y1,1)
Shade(Y1,Y2,2)
13.347->[A](1,1)
35.011->[A](2,1)
48.421->[A](3,1)
75.242->[A](4,1)
19.111->[A](1,2)
40.888->[A](2,2)
75.111->[A](3,2)
56.444->[A](4,2)

---------
Program 6: TankDraw

(98/96)->I
(98/64)->J
PT-On(K+I,L)
Line(K,L,K+2I,L)
Line(K,L-J,K+2I,L-J)
Line(K,L-2J,K+2I,L-2J)
If O=0
Goto 3
Line (K,L+2J,K+2I,L+2J)
Lbl 3

Program 7: Explosion Checker

IPart U->U
IPart V->V
IPart R->R
IPart S->S
IPart P->P
IPart Q->Q
If abs(U-R)<NI
Goto q
Goto Z
Lbl q
If abs(V-S)<NJ
2->W
Goto Y
Lbl Z
If abs (U-P)<NI
Goto X
Goto Y
Lbl X
If abs (V-Q)<NJ
1->W
Lbl Y

(Note: Programs must be installed as the indicated number in the calculator.)
Newsgroups: comp.sys.handhelds