Three-in-a-row v2.0
-------------------------------------------------------------------------
Version: 2.0, 980222
Creator: Daniel Bergman (Daniel.Bergman@Writeme.com)
Description: Play three-in-a-row against the calculator. Graphic version.
Size: about 1031 bytes.
Known bugs: None.
Comments: "->" is the same thing as the "STO>"-button.
Be careful with the difference between { and (
For more games and programs, please visit http://ti80.burtrask.net.
PROGRAM:TIR
1->XMIN
4->XMAX
1->YMIN
4->YMAX
FNOFF
PLOTSOFF
CLRDRAW
FOR(A,1,4
VERTICAL A
HORIZONTAL A
END
CLRLIST L1
9->DIM L1
0->G:0->W:0->I
LBL 0
IF I
PRGM_XAI
IF G+FPART .5R=2
PRGM_XAI
IF I=0:THEN
R->C
RANDINT(1,9->R
IF G=0 5->R
IF G=2
2RANDINT(1,4->R
IF G=4
2RANDINT(1,5)-1->R
END
0->S
IF L1(R
GOTO 0
PRGM_XRIT
1->L1(R
PRGM_XWIN
IF W:GOTO S
G+2->G
IF G>8:GOTO S
LBL 1
INPUT
5->R
1->S
IF (X<2)(Y<2:1->R
IF (X>2)(X<3)(Y<2:2->R
IF (X>3)(Y<2:3->R
IF (X<2)(Y>2)(Y<3:4->R
IF (X>3)(X>2)(Y<3:6->R
IF (X<2)(Y>3):7->R
IF (X>2)(X<3)(Y>3:8->R
IF (X>3)(Y>3):9->R
IF L1(R
GOTO 1
PRGM_XRIT
2->L1(R
PRGM_XWIN
IF W:GOTO S
GOTO 0
LBL S
IF W=1
DISP "I WIN"
IF W=2
DISP "U WIN"
IF W=0
DISP "TIE"
CLRLIST L1,L2,L3
PROGRAM:XRIT
{1,1,2,2->L3
IF R=2
{2,1,3,2->L3
IF R=3
{3,1,4,2->L3
IF R=4
{1,2,2,3->L3
IF R=5
{2,2,3,3->L3
IF R=6
{3,2,4,3->L3
IF R=7
{1,3,2,4->L3
IF R=8
{2,3,3,4->L3
IF R=9
{3,3,4,4->L3
LINE(L3(1),L3(2),L3(3),L3(4
IF S
LINE(L3(3),L3(2),L3(1),L3(4
PROGRAM:XAI
1->I
IF G=2:THEN
{3,7,6,4,9->L2
IF R=4
{1,9,2,8,3->L2
IF R=6
{9,1,8,2,7->L2
IF R=8
{9,1,6,4,3->L2
END
L2(1->R
IF G=4:THEN
IF L1(L2(2
THEN
L2(3->R:ELSE
L2(2->R
END:END
IF G=6:THEN
IF L1(L2(4
THEN
L2(5->R:ELSE
L2(4->R
PROGRAM:XWIN
S+1->W
IF (L1(1)=W)(L1(2)=W)(L1(3)=W)
RETURN
IF (L1(4)=W)(L1(5)=W)(L1(6)=W)
RETURN
IF (L1(7)=W)(L1(8)=W)(L1(9)=W)
RETURN
IF (L1(1)=W)(L1(4)=W)(L1(7)=W)
RETURN
IF (L1(2)=W)(L1(5)=W)(L1(8)=W)
RETURN
IF (L1(3)=W)(L1(6)=W)(L1(9)=W)
RETURN
IF (L1(1)=W)(L1(5)=W)(L1(9)=W)
RETURN
IF (L1(3)=W)(L1(5)=W)(L1(7)=W)
RETURN
0->W
--------------------------------------------------------------------
Copyright (C) 1998 by Daniel Bergman
http://ti80.burtrask.net