Article View: bit.listserv.graph-ti
Article #1955Re: Tetris search
From: adaml10028
Date: Thu, 20 Jan 1994 05:24
Date: Thu, 20 Jan 1994 05:24
171 lines
5304 bytes
5304 bytes
Sure, no problem. Here's the text for tetris, and I suggest the "tennis"
game that's available from the archives.
Hello Everyone,
Here's the Tetris text for the TI-85 for those of you who are interested. If
you have a link you can wait until it is translated into the EUU format,
(thanks to everyone who offered to translate it), otherwise, you can type it
in directly.
The game runs very simiar to the arcade version. The right arrow
moves the falling block to the right, the left arrow moves it left. The
"MORE" button spins the falling block clockwise. Everytime you complete a
row, all the blocks slide down and the row-counter in the upper-right corner
keeps track of your score.
It runs somewhat fast, especially if you have new batteries and you have
some memory free. (The program, plus the matrixes used, adds up to about
3500) Those of you advanced programers might notice a few redundant or
unneccessary lines, but I chose to leave it as it is rather than to risk
introducing flaws.
7 notes of Caution:
1) Before you run it, you must create a 8x21 matrix named, "Blocks"
2) This is quite a long program, so I can't insure that I copied it
perfectly, if you run into errors or problems, please contact me at
Adaml10028@aol.com.
3) When a block hits the bottom, you have one chance to move it one space to
the left or right. This will allow you to "sneak" a block under an overhang,
but it may also mean that a block gets stranded in midair. (You'll see what
I'm talking about when your playing)
4) "->" means "store to". "-" is a minus sign.
5) When ever you see spaces contained within quotes inside and Outpt
statement, be sure to count the number of spaces.
6) "<>" means "not equal to" (The saign on the 85 looks like an equal sign
with a cross through it.)
7) an "0" is a zero. an "O" is an uppercase o.
Feel free to translate the program into any other form, including the 82 or
some other application. (If you do, please send me Email about it and
possibly a copy of the program. I'd be very interested) I hope that the
concepts used will help everyone to write new and exciting stuff.
---Adam Lieb
Here's the text:
:Fill(0,Blocks)
:ClLCD
:For(y,1,8,1)
:For(x,1,4,1)
:If (x==4)+(x==3)
:1->Blocks(y,4)
:Outpt(y,x,"X"
:End
:For(x,17,21,1
:If (x==17)+(x==18)
:1->Blocks(y,17)
:Outpt(y,x,"X"
:End
:End
:0->Row
:Outpt(1,19," "
:Outpt(1,20,ROW
:Lbl BUILD
:rand->MM
:If MM<(1/7)
:[[0,0][1,0][0,1][1,1]]->BALL
:If (MM>1/7)(MM<2/7)
:[[-1,0][0,0][1,0][2,0]]->BALL
:If (MM>2/7)(MM<3/7)
:[[0,0][-1,0][0,1][1,1]]->BALL
:If (MM>3/7)(MM<4/7)
:[[0,0][1,0][0,1][-1,1]]->BALL
:If (MM>4/7)(MM<5/7)
:[[0,0][-1,0][1,0][0,1]]->BALL
:If (MM>5/7)(MM<6/7)
:[[0,0][1,0][-1,0][-1,1]]->BALL
:If (MM>6/7)
:[[0,0][1,0][-1,0][1,1]]->BALL
:10->X
:2->Y
:Lbl MAIN
:1->L
:1->R
:For(x,1,4,1)
:int (BALL(x,2)+Y)->YY
:int (BALL(X,1)+X)->XX
:If Blocks(YY,XX-1)==1
:0->L
:If Blocks(YY,XX+1)==1
:0->R
:If (Blocks(YY+1(YY<8),XX)==1)+(int (BALL(x,2)+Y)==8)
:Goto HIT
:Lbl Luck
:Outpt(YY,XX,"O")
:End
:For(x,1,4,1)
:Outpt(int (BALL(x,2)+Y),int (BALL(x,1)+X)," ")
:End
:Lbl LUCK
:Y+1->Y
:getKy->A
:If A<>0:Then
:If (A==24)(1==L):Then
:X-1->X
:Y-.8->Y
:End
:If (A==26)(1==R):Then
:X+1->X
:Y-.8->Y
:End
:If (A==23)(X>6)(X<14)(Y<7)(Y>2):Then
:For(x,1,4,1)
:(BALL(x,2))->A
:BALL(x,1)->BALL(x,2)
:-A->BALL(x,1)
:End
:Y-.8->Y
:End
:End
:Goto MAIN
:
:Lbl HIT
:getKy->A
:1->L
:1->R
:For(x,1,4,1)
:Outpt(int (BALL(x,2)+Y),int (BALL(x,1)+X)," "
:If Blocks(int (BALL(x,2)+Y),int (BALL(x,1)+X)-1)==1
:0->L
:If Blocks(int (BALL(x,2)+Y),int (BALL(x,1)+X)+1)==1
:0->R
:End
:If (A==24)(1==L)
:X-1->X
:If (A==26)(1==R)
:X+1->X
:For(x,1,4,1)
:If (int (BALL(x,2)+Y)==2):Then
:ClLCD
:Disp "SCORE="
:Disp Row
:Stop
:End
:Outpt(int (BALL(x,2)+Y),int (BALL(x,1)+X),"O")
:1->Blocks(int (BALL(x,2)+Y),int (BALL(x,1)+X))
:End
:0->C
:For(x,1,8,1)
:If Blocks(x,5,x,16)==[[1,1,1,1,1,1,1,1,1,1,1,1]]:Then
:Blocks(1,1,x-1,21)->Blocks(2,1)
:[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]->Blocks(1,1)
:1->C
:ROW+1->ROW
:End
:End
:
:If C==1:Then
:For(x,5,16,1)
:For(y,1,8,1)
:If Blocks(y,x)==1:Then
:Outpt(y,x,"O")
:Else
:Outpt(y,x," ")
:End
:End
:End
:End
:10->X
:2->Y
:Outpt(1,20,ROW
:Goto BUILD
Technical Details
Message-ID:
<9401200018.tn192546@aol.com>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!zib-berlin.de!zrz.TU-Berlin.DE!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!paladin.american.edu!auvm!aol.com!adaml10028Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 104512,ddc35a094d138005 X-Google-Attributes: gid104512,public X-Google-ArrivalTime: 1994-01-20 06:50:15 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!zib-berlin.de!zrz.TU-Berlin.DE!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!paladin.american.edu!auvm!aol.com!adaml10028 Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: bit.listserv.graph-ti Return-Path: <@AUVM.AMERICAN.EDU:graph-ti@LISTS.ACS.OHIO-STATE.EDU> Date: Thu, 20 Jan 1994 00:24:28 -0500 Message-ID: <9401200018.tn192546@aol.com> Errors-To: gregt@math.ohio-state.edu Reply-To: graph-ti@lists.acs.ohio-state.edu Originator: graph-ti@lists.acs.ohio-state.edu Sender: graph-ti@lists.acs.ohio-state.edu Precedence: bulk From: <adaml10028@aol.com> Subject: Re: Tetris search X-Listprocessor-Version: 6.0a -- ListProcessor by Anastasios Kotsikonas X-Comment: Texas Instruments Graphing Calculators Lines: 170