Jump to content

Recommended Posts

On 1/8/2022 at 3:35 PM, trapperkeeper said:

Does anybody know of where to find a copy of this?

 

 

I found a file called ZTETRIS2 via WEB99

 

 

Spoiler

100 DISPLAY ERASE ALL AT(8,12):"Tetris" :: DISPLAY AT(10,3):"(C) 1989 STEVEN KARASEK" :: DISPLAY AT(12,2):"BELLS AND WHISTLES 1/90 JBC"
103 DISPLAY AT(15,2):"AFTER MAKING GAME SELECTIONS  A SHORT DELAY WILL OCCUR."
105 DISPLAY AT(22,2):"NEED INSTRUCTIONS? (Y or N)" :: CALL KEY(0,M,W):: IF W=0 THEN 105 :: CALL CLEAR :: IF M=89 OR M=121 THEN 700 ELSE 110
110 PRINT "STARTING LEVEL (1-9)";:: INPUT E :: E=INT(E):: IF E<1 OR E>9 THEN 110 ELSE E=10-E
115 CALL CLEAR :: PRINT "*MAKE SURE ALPHA LOCK IS UP*ENTER KEYS(1) OR JOYSTICK(2)" :: INPUT AA :: IF AA<1 OR AA>2 THEN 115
117 CALL CLEAR :: INPUT "PLAY PAUSE(1) OR FREEFALL(2)??":BA :: IF BA<1 OR BA>2 THEN 117
118 CALL CLEAR :: INPUT "DISPLAY PAUSE? NO(1) YES(2)":CA :: IF CA<1 OR CA>2 THEN 118
120 DIM Z$(23),Z(26),A(18,3),B(18,3):: RANDOMIZE :: C$="jkl; uqsdfar" :: Z(24)=4095 :: CALL MAGNIFY(4):: CALL CLEAR :: FOR I=0 TO 6
130 READ N(I),C(I):: CALL COLOR(I+8,2,C(I)):: NEXT I :: FOR I=0 TO 18 :: FOR J=0 TO 3 :: READ A(I,J),B(I,J):: NEXT J :: NEXT I
140 FOR I=68 TO 143 :: READ X$ :: CALL CHAR(I,X$):: NEXT I :: CALL CHAR(41,"FFFFFFFFFFFFFFFF")
150 FOR I=0 TO 23 :: Z$(I)=RPT$(")",10):: Z(I)=2049 :: NEXT I :: V=E :: D,P=24 :: U=0 :: GOSUB 450 :: CALL VCHAR(1,12,41,240)
160 GOSUB 600
170 P=0 :: Q=4 :: J=INT(RND*7):: S=J*2 :: J8=J*8+89 :: IF J>3 THEN S=S-1+2*(J-4)
180 GOSUB 470 :: T=0 :: X=1 :: Y=Q*8+81 :: CALL SPRITE(#1,K,C(J),X,Y)
190 IF Z(0)AND 2^(Q+Y1)OR Z(X2)AND 2^(Q+Y2)OR Z(X3)AND 2^(Q+Y3)OR Z(X4)AND 2^(Q+Y4)THEN 430
200 FOR I=1 TO V :: IF AA=2 THEN 610 :: CALL KEY(0,M,W):: IF M<0 THEN 350 ELSE ON POS(C$,CHR$(M),1)+1 GOTO 350,210,280,230,340,250,330,440,210,280,230,340,330
210 Q=Q-1 :: IF Z(P)AND 2^(Q+Y1)OR Z(P+X2)AND 2^(Q+Y2)OR Z(P+X3)AND 2^(Q+Y3)OR Z(P+X4)AND 2^(Q+Y4)THEN Q=Q+1 ELSE Y=Y-8
220 CALL LOCATE(#1,X,Y):: GOTO 350
230 Q=Q+1 :: IF Z(P)AND 2^(Q+Y1)OR Z(P+X2)AND 2^(Q+Y2)OR Z(P+X3)AND 2^(Q+Y3)OR Z(P+X4)AND 2^(Q+Y4)THEN Q=Q-1 ELSE Y=Y+8
240 GOTO 220
250 Y1=2^(Q+Y1):: Y2=2^(Q+Y2):: Y3=2^(Q+Y3):: Y4=2^(Q+Y4):: GOSUB 450 :: P=D-X4
260 IF (Z(P)AND Y1 OR Z(P+X2)AND Y2 OR Z(P+X3)AND Y3 OR Z(P+X4)AND Y4)=0 THEN P=P+1 :: GOTO 260
270 P=P-1 :: CALL LOCATE(#1,P*8+1,Y):: GOTO 380
280 S=S-1 :: T=T-1 :: IF T<0 THEN T=N(J)-1 :: S=S+N(J)
290 GOSUB 470
300 IF (Z(P)AND 2^(Q+Y1)OR Z(P+X2)AND 2^(Q+Y2)OR Z(P+X3)AND 2^(Q+Y3)OR Z(P+X4)AND 2^(Q+Y4))=0 THEN CALL PATTERN(#1,K):: GOTO 350
310 S=S+1 :: T=T+1 :: IF T=N(J)THEN T=0 :: S=S-N(J)
320 GOSUB 470 :: GOTO 350
330 CALL KEY(0,M,W):: IF W<>0 THEN 330 ELSE V=V+(V>1):: GOSUB 460 :: GOTO 350
340 IF BA=2 THEN 350 :: CALL KEY(0,M,W):: IF W<>1 THEN 345 ELSE 350 :: GOTO 340
345 IF CA=2 THEN GOSUB 670 ELSE 340 :: GOTO 340
350 IF CA=2 THEN GOSUB 680 ELSE 355
355 SW=0 :: NEXT I :: P=P+1 :: IF P+X4>=D THEN 370
360 X=X+8 :: CALL LOCATE(#1,X,Y):: GOTO 200
370 IF (Z(P)AND 2^(Q+Y1)OR Z(P+X2)AND 2^(Q+Y2)OR Z(P+X3)AND 2^(Q+Y3)OR Z(P+X4)AND 2^(Q+Y4))=0 THEN 360 ELSE P=P-1 :: GOSUB 450
380 D=MIN(D,P):: FOR I=0 TO 3 :: W=Q+B(S,I):: M=P+A(S,I):: Z(M)=Z(M)+2^W :: Z$(M)=SEG$(Z$(M),1,W-1)&CHR$(J8)&SEG$(Z$(M),W+1,10)
390 CALL HCHAR(M+1,W+11,J8):: NEXT I :: CALL DELSPRITE(#1):: FOR I=MIN(P+3,23)TO P STEP -1 :: IF Z(I)<4095 THEN 420 ELSE J=I :: M=I-1
400 Z(J)=Z(M):: Z$(J)=Z$(M):: DISPLAY AT(J+1,10):Z$(J):: IF Z(J)>2049 THEN J=J-1 :: M=M-1 :: GOTO 400
410 U=U+INT(500/V):: GOSUB 460 :: I=I+1 :: P=P-1 :: D=D+1
420 NEXT I :: CALL SOUND(50,500,4):: SW=0 :: GOTO 170
430 H=MAX(H,U):: DISPLAY AT(1,20):USING "#########":H :: CALL DELSPRITE(#1):: GOSUB 600 :: GOTO 150
440 DISPLAY ERASE ALL:"HIGH SCORE IS";MAX(U,H):: END
450 U=U+INT((24-P)*100/V)
460 DISPLAY AT(3,20):USING "#########":U :: V=MIN(V,MAX(1,9-INT(U/5000))):: DISPLAY AT(3,4)SIZE(2):10-V :: RETURN
470 X2=A(S,1):: X3=A(S,2)::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FFF0F0F0F,,F0F0F0F,,0F0F0F0F,,F0F0F0F0F0F0F0F,F0F0F0F0
600 CALL SOUND(200,400,6):: CALL SOUND(300,300,4):: CALL KEY(0,M,W):: IF M<>98 THEN 600 :: RETURN
610 CALL JOYST(1,JX,JY):: JZ=((JX+3*JY)/4)+5
620 ON JZ GOTO 630,280,630,210,630,230,630,650,630
630 CALL KEY(5,JM,W):: IF JM=113 THEN 440 :: IF JM=117 THEN 330
640 CALL KEY(1,JM,W):: IF JM=18 THEN 250 ELSE 660
650 SW=(SW-1)*-1
660 IF BA=2 OR SW=0 THEN 350 :: IF CA=2 THEN GOSUB 670 ELSE 610 :: GOTO 610
670 DISPLAY AT(12,23):"aaa" :: FOR F=1 TO 20 :: NEXT F :: RETURN
680 DISPLAY AT(12,23):CHR$(129);CHR$(129);CHR$(129):: RETURN
700 CALL CLEAR :: PRINT "OBJECTIVE:   To fit falling blocks into a solid line andremove that line. Game ends when pattern builds to top.":
710 PRINT :: PRINT "SCORING:  Points are scored when block lands or line is made. Points go up as level rises or height block drops from or lands on increases."
720 PRINT :: PRINT "PLAYING:  Level is shown on left-high and game scores onright. level & speed may be increased during game using"
730 PRINT "U/R keys. Automatic increaseoccurs every 5000 points.   " :: PRINT
740 PRINT "   PAUSE does not work when playing FREEFALL. If playing"
750 PRINT "DISPLAY, pause is shown by aRed bar, fall by green." :: PRINT ::
760 DISPLAY AT(24,2):"(PRESS ANY KEY TO CONTINUE)" :: CALL KEY(0,M,W):: IF W=1 THEN 770 ELSE 760
770 CALL CLEAR :: PRINT "CONTROLS: Use keyboard or #1joystick as shown below to  move block or change game." :: PRINT ::
780 PRINT TAB(3);"KEYBOARD";TAB(18);"JOYSTICK" :: PRINT :: PRINT "Left----S or J : Left" :: PRINT "Right---F or L : Right"
790 PRINT "Rotate--D or K : Down" :: PRINT "Drop----Space  : Fire" :: PRINT "Pause---A or ; : Up" :: PRINT "Resume--Any    : Up"
800 PRINT "Level---R or U : R or U key" :: PRINT "Quit----Q      : Q key" :: PRINT :: PRINT "BEGIN NEW GAME BY PRESSING BWHEN TONE SOUNDS"
810 PRINT :: PRINT :: PRINT :: DISPLAY AT(24,1):"*PRESS ANY KEY TO START PLAY"
820 CALL KEY(0,M,W):: IF W=0 THEN 820 :: CALL CLEAR :: GOTO 110

 

 

  • Like 1

Share this post


Link to post
Share on other sites
23 hours ago, Schmitzi said:

100 DISPLAY ERASE ALLAT(8,12):"Tetris"

Great implementation! But there is a blank missing:  ERASE ALLAT(8,12)  ==>  ERASE ALL AT(8,12)

  • Thanks 1

Share this post


Link to post
Share on other sites

I've got a half-baked version of XB (to be compiled) Tetris that I mean to get back to....

 

Someone on here complained about there not being a good Tetris - years ago.  That was a CTA for me, but...  The phone has stopped ringing.  It needs to ring again.

 

For the curious: https://github.com/unhuman/ti99/tree/master/howtris

Edited by unhuman
  • Like 2

Share this post


Link to post
Share on other sites
10 hours ago, SteveB said:

Great implementation! But there is a blank missing:  ERASE ALLAT(8,12)  ==>  ERASE ALL AT(8,12)

 

Changed :thumbsup:

 

Share this post


Link to post
Share on other sites

I seem to remember that the C64 was able to parse BASIC commands with missing spaces like PRINTA. (Well, its variable names only had two significant characters, so nothing to be too proud of.)

 

Share this post


Link to post
Share on other sites
5 hours ago, mizapf said:

I seem to remember that the C64 was able to parse BASIC commands with missing spaces like PRINTA. (Well, its variable names only had two significant characters, so nothing to be too proud of.)

CBM BASIC is very forgiving with formatting. You can write an entire program with little to no spacing.  I actually like the two character variable name limitation, at least on the back-end of things as it makes working directly with variable memory much easier. As I continued in my TI programming in parallel with CBM BASIC, I adopted shortened variable names to save memory on the TI.

Share this post


Link to post
Share on other sites
6 hours ago, OLD CS1 said:

CBM BASIC is very forgiving with formatting. You can write an entire program with little to no spacing.  I actually like the two character variable name limitation, at least on the back-end of things as it makes working directly with variable memory much easier. As I continued in my TI programming in parallel with CBM BASIC, I adopted shortened variable names to save memory on the TI.

But PRINT 3^4 gives 81.0000001 on the C64 ...

Share this post


Link to post
Share on other sites
13 minutes ago, SteveB said:

But PRINT 3^4 gives 81.0000001 on the C64 ...

Microsoft BASIC floating point ain't perfect.  ISTR this being a poor choice of IEEE FP used by Microsoft to save memory space.  (I think that was in Bagnall's book.)

 

ALSO does not negate my point :P  That would still be forgiving on formatting, right?

Share this post


Link to post
Share on other sites

You are right about the formatting ... but I would like to justify my disliking of the CBM BASIC somehow ...  😇

  • Haha 1

Share this post


Link to post
Share on other sites
3 minutes ago, SteveB said:

You are right about the formatting ... but I would like to justify my disliking of the CBM BASIC somehow ...  😇

Fair enough. :) One trick to use in CBM BASIC when you are expecting to work with integers is the integer variable datatype.  For instance: A%=3^4 and A% will be exactly 81.

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...