Jump to content
oddemann

HELP - I AM STUCK! - TI EXtended BASIC

Recommended Posts

Did you receive an error? It looks legit, it relates to the printer, so I suppose you need to test the command. I don't have a printer to test it with... 😢

Edited by GDMike

Share this post


Link to post
Share on other sites
22 minutes ago, oddemann said:

New program I am testing... BUT... in line 160 I find this, "@=23" the character in the book dos not look anything like @, been trying to figure this one... I think it has to do with printing on paper. So the main question, is the listing correct with @ in it?

Book "entertainment-games-in-ti-basic-and-extended-basic", program: Biorhythm
From here: http://www.hexbus.com/tibooks/

Downloaded the files, then as it did not work, I "fixed" it (downloaded the PDF to look), but could not make out @ character. So I ask you!

 

  Reveal hidden contents

10 !/////////////
20 !/ BIORHYTHM /
30 !/////////////
40 !
50 !///INITIALIZE///
60 DIM DOM(12) :: ON WARNING NEXT :: CALL INIT :: CALL LOAD(-31878,0)
70 DATA 31,28,31,30,31,30,31,31,30,31,30,31
80 FOR I=1 TO 12 :: READ S :: K=K+S :: DOM(I)=K :: NEXT I
90 CALL CHAR(39,"000000007E",96,"1899FF1818246642",104,"0066E7FFFF7E3C18",112,"1014583FFC1A2808",120,"817E665A5A667E81")
100 CALL COLOR(9,11,1,10,9,1,11,5,1,12,13,1)
110 !///OPENING///
120 CALL CLEAR :: CALL SCREEN(16) :: CALL COLOR(2,9,1)
130 A$=RPT$(" ",7) :: B$=RPT$("*",13) :: C$="*           *" :: PRINT A$;B$:A$;C$:A$;"* BIORHYTHM *":A$;C$:A$;B$: : : : : : : : : : : : : :"NEED INSTRUCTIONS?(Y/N)*";
140 CALL CHARPAT(42,A$) :: B$="000000103810"
150 CALL KEY(0,K,S) :: IF K=78 THEN 320 ELSE IF K<>89 THEN CALL SOUND(100,110,3) :: CALL CHAR(42,B$) :: CALL SOUND(200,110,16) :: CALL CHAR(42,A$) :: CALL SOUND(400,44733,30) :: GOTO 150
160 INPUT "TO PRINTER OR SCREEN?(P/S)":A$ :: IF A$="P" THEN FILE=1 :: @=23 :: OPEN #1:"RS232.DA=8.BA=4800" ELSE IF A$<>"S" THEN 160 ELSE FILE=0 :: @=1
170 !//INSTRUCTIONS//
180 DATA "********* BIORHYTHM ********",,"*THE THEORY OF BIORHYTHM","STATES THAT EVERYONE HAS","THREE CYCLES WHICH START ON"
190 DATA THE DAY OF HIS BIRTH.,,*THESE CYCLES ARE:,-----PHYSICAL CYCLE(23 DAYS),----EMOTIONAL CYCLE(28 DAYS)
200 DATA -INTELLECTUAL CYCLE(33 DAYS),,"*IN THIS PROGRAM,CYCLES SPAN",FROM -1(LOW) TO 1(HIGH).
210 DATA ,"*""HIGH"" DAYS OF A CYCLE ARE",WHEN FIGURES OF THAT CYCLE,"RISE ABOVE THE MIDDLE LINE,","AND ""LOW"" DAYS ARE BELOW IT."
220 DATA,*WHEN ALL 3 OF THE CYCLES,COINCIDE ABOVE THE MIDDLE,"LINE,PERSON IS AT HIS BEST!"
230 CALL CLEAR :: RESTORE 180 :: FOR I=1 TO 23 :: READ A$ :: PRINT #FILE:TAB(@);A$ :: NEXT I :: IF FILE=1 THEN 250 ELSE PRINT "****PRESS ANY KEY";
240 CALL KEY(0,K,S) :: IF S=0 THEN 240
250 CALL CLEAR :: PRINT "*WHEN ASKED FOR THESE KEYS, THEY HAVE THE FOLLOWING":"FUNCTIONS:"
260 PRINT:"-PROCEED: CONTINUE PROGRAM": :"-REDO: BACK TO INPUT SCREEN": :"-": IF IN INPUT, SCREEN WILL":"PRINT TO PRINTER 12 MONTHS"
270 PRINT "    IF IN GRAPH, SCREEN WILL PRINT TO PRINTER BIORHYTHM  GRAPH": :"-BEGIN: ASK FOR DIFFERENT   NAME": :"-BACK: END PROGRAM"
280 PRINT #FILE: :TAB(@);"*AVERAGE OF CYCLES IS THE":TAB(@);"AVERAGE ON DAY LISTED.";CHR$(12)
290 PRINT:"****PRESS ANY KEY";
300 CALL KEY(0,K,S) :: IF S=0 THEN 300 ELSE IF FILE=1 THEN CLOSE #1
310 !///START///
320 CALL CLEAR :: RD,PR=0 :: CALL CHAR(43,"0010101010101")
330 INPUT "WHAT IS YOUR NAME?":N$ :: CALL CLEAR :: PRINT: : :"HELLO ";N$: : : : : : : : : : : :: CALL SAY("HELLO")
340 !//MONTHS//
350 DATA JANUARY,3,FEBRUARY,0,MARCH,3,APRIL,2,MAY,3,JUNE,2,JULY,3,AUGUST,3,SEPTEMBER,2,OCTOBER,3,NOVEMBER,2,DECEMBER,3
360 !//BIRTHDATES//
370 !DATA ODD KRISTENSEN, AUGUST,11,1968
380 !DATA**IN THIS FORM:<NAME,MONTH,DATE,YEAR>. EXAMPLE: JOE BLOW,JANUARY,1,1892,MARY BLOW,APRIL,4,1983 ETC...
390 !DATA**BUT PUT IT BEFORE DATA ZZZ,ZZZ,0,0
400 DATA ZZZ,ZZZ,0,0
410 DISPLAY AT(1,1)ERASE ALL:"*********BIRTHDATE**********": : :"MONTH OF BIRTH:": :"DATE OF BIRTH:": :"YEAR OF BIRTH:"
420 IF RD THEN 450
430 RESTORE 370
440 READ A$,MO$,DA,YR :: IF A$="ZZZ" THEN 460 ELSE IF A$<>N$ THEN 440
450 DISPLAY AT(4,20)BEEP:MO$ :: DISPLAY AT(6,19):DA :: DISPLAY AT(8,19):YR :: GOTO 510
460 CALL SAY("PLEASE+ANSWER THEN PRESS+ENTER") :: ACCEPT AT(4,20)SIZE(-9)BEEP:MO$ :: ACCEPT AT(6,20)SIZE(-2)BEEP:DA :: ACCEPT AT(8,20)SIZE(-4)BEEP:YR
470 IF(DA>0 AND YR>0 AND DA=INT(DA)AND YR=INT(YR))THEN 510
480 CALL SAY("#THAT IS INCORRECT# #TRY AGAIN#") :: GOTO 460
490 IF I=13 THEN B$="WHAT IS A "&MO$&"?" ELSE B$=STR$(DA)&" DAYS IN "&MO$&"?!?"
500 DISPLAY AT(24,1):B$ :: GOTO 460
510 RESTORE 350
520 FOR I=1 TO 12 :: READ A$,BT :: IF A$=MO$ THEN MO=I :: I=14
530 NEXT I :: IF YR/4=INT(YR/4)AND BT=0 THEN BT=1
540 IF I=13 OR DA>BT+28 THEN 490
550 DISPLAY AT(24,1)BEEP:"PRESS PROCEED,REDO OR """
560 CALL KEY(0,K,S) :: IF K=6 THEN 460 ELSE IF K=34 THEN 570 ELSE IF K=12 THEN 600 ELSE 560
570 DISPLAY AT(24,1):"IS PRINTER READY?(Y/N):N" :: ACCEPT AT(24,24)SIZE(-1)VALIDATE("YN"):A$ :: IF A$="N" THEN 550 ELSE DISPLAY AT(24,1):"WHAT YEAR?1983" :: ACCEPT AT(24,11)SIZE(-4)VALIDATE(DIGIT):YR1
580 IF YR1<YR THEN 570
590 DISPLAY AT(24,1):"STARTING MONTH:JANUARY" :: ACCEPT AT(24,16)SIZE(-9)BEEP:MO1$ :: GOTO 690
600 DISPLAY AT(12,1):"*******PROJECTION DAY*******": : :"THE MONTH:": :"THE DATE:": :"THE YEAR:": : : : : :
610 IF K=34 THEN 720 ELSE CALL SAY("PLEASE+ANSWER THEN PRESS+ENTER")
620 DISPLAY AT(19,20):"1983"
630 ACCEPT AT(15,20)SIZE(-9)BEEP:MO1$ :: ACCEPT AT(17,20)SIZE(-2)BEEP:DA1 :: ACCEPT AT(19,20)SIZE(-4)BEEP:YR1
640 IF(DA1>0 AND YR1>0 AND DA1=INT(DA1)AND YR1=INT(YR1)AND YR<=YR1)THEN 740
650 CALL SAY("#THAT IS INCORRECT# #TRY AGAIN#") :: GOTO 630
660 IF I=13 THEN B$="   INVENTED A NEW MONTH?" ELSE B$="ONLY "&STR$(NT+28)&" DAYS IN "&MO1$
670 DISPLAY AT(24,1):B$ :: GOTO 630
680 !///LOOPS FOR 1 YEAR///
690 RESTORE 350
700 FOR I=1 TO 12 :: READ A$,NT :: IF A$=MO1$ THEN MO1=I :: I=14
710 NEXT I :: IF I=13 THEN 590
720 PR=1 :: DA1=15 :: FOR LFY=MO1 TO 12 :: RESTORE 350 :: FOR K=1 TO LFY :: READ MO1$,NT :: NEXT K :: MO1=LFY
730 DISPLAY AT(15,20)BEEP:MO1$ :: DISPLAY AT(17,19):DA1 :: DISPLAY AT(19,19):YR1 :: GOTO 790
740 RESTORE 350
750 FOR I=1 TO 12 :: READ A$,NT :: IF A$=MO1$ THEN MO1=I :: I=14
760 NEXT I :: IF YR1/4=INT(YR1/4)AND NT=0 THEN NT=1
770 IF I=13 OR DA1>NT+28 THEN 660
780 DISPLAY AT(24,1)BEEP:"   PRESS PROCEED OR REDO"
790 CALL KEY(0,K,S) :: IF K=6 THEN 630 ELSE IF K<>12 AND PR=0 THEN 790
800 !//DAYS LIVED//
810 DTB=INT(365.25*YR+DOM(MO-1))+DA
820 DTN=INT(365.25*YR1+DOM(MO1-1))+DA1
830 DL=DTN-DTB
840 !///SINE GRAPH///
850 DISPLAY AT(1,1)ERASE ALL:"*********BIORHYTHM**********": :"NAME: ";N$:"+=";MO1$;" ";STR$(DA1);",";YR1
860 CALL HCHAR(12,2,39,31) :: CALL VCHAR(5,16,43,14)
870 DISPLAY AT(20,1):CHR$(96);"=PHYSICAL CYCLE":CHR$(104);"=EMOTIONAL CYCLE":CHR$(112);"=INTELLECTUAL CYCLE"
880 DISPLAY AT(24,1):"PRESS REDO,BEGIN,",OR BACK"
890 CALL GRAPH(23,DL) :: CALL GRAPH(28,DL) :: CALL GRAPH(33,DL)
900 DISPLAY AT(23,1):"AVERAGE OF CYCLES:";SEG$(STR$((SIN(PI/180*360*DL/23)+SIN(PI/180*360*DL/28)+SIN(PI/180*360*DL/33))/3),1,7)
910 CALL KEY(0,K,S) :: IF K=6 THEN RD=1 :: GOTO 410 ELSE IF K=14 THEN 320 ELSE IF K=15 THEN CALL CLEAR :: STOP ELSE IF K<>34 AND PR=0 THEN 910
920 !///PRINTOUT///
930 @=16 :: GR$=CHR$(27)&"K"&CHR$(8)&CHR$(0) :: B$=CHR$(96)&CHR$(35)&CHR$(38)&CHR$(248)&CHR$(248)&CHR$(38)&CHR$(35)&CHR$(96)!/MAN/
940 C$=CHR$(56)&CHR$(124)&CHR$(126)&CHR$(31)&CHR$(31)&CHR$(126)&CHR$(124)&CHR$(56)!/HEART/
950 D$=CHR$(8)&CHR$(40)&CHR$(26)&CHR$(252)&CHR$(63)&CHR$(88)&CHR$(20)&CHR$(16)!/CROSS/
960 E$=RPT$(CHR$(0),8)!/SPACE/
970 F$=CHR$(0)&RPT$(CHR$(8),6)&CHR$(0)!/DASH/
980 G$=RPT$(CHR$(0),4)&CHR$(255)&RPT$(CHR$(0),3)
990 H$=CHR$(129)&CHR$(126)&CHR$(102)&CHR$(153)&CHR$(153)&CHR$(102)&CHR$(126)&CHR$(129)!/COINC/
1000 OPEN #1:"RS232.DA=8.BA=4800.CR"
1010 PRINT #1:CHR$(14);TAB(16);"BIORHYTHM";CHR$(10);CHR$(10);TAB(@);"NAME: ";N$;CHR$(10);TAB(@);"BIRTHDATE: ";MO$;" ";STR$(DA);",";YR;CHR$(10)
1020 PRINT #1:TAB(@);GR$&G$;CHR$(27);"E";"=";MO1$;" ";STR$(DA1);",";YR1;CHR$(@);CHR$(10);CHR$(27);"F";CHR$(10)
1030 IF DA1<>15 THEN 1060 ELSE A$="1234567890123456789012345678" :: IF MO1=2 AND YR1/4=INT(YR1/4)THEN A$=A$&"9" ELSE A$=A$&SEG$("901",1,NT)
1040 PRINT #1:TAB(@);
1050 FOR I=1 TO LEN(A$) :: PRINT #1:CHR$(27);"K";CHR$(2);CHR$(0);CHR$(0);CHR$(0);SEG$(A$,I,1) :: NEXT I :: PRINT #1:CHR$(10)
1060 FOR I=5 TO 18 :: A$="" :: FOR K=2 TO 32 :: CALL GCHAR(I,K,S) :: IF S=39 THEN A$=A$&F$ ELSE IF S=120 THEN A$=A$&H$ ELSE IF S>95 THEN 1080 ELSE IF S=43 THEN A$=A$&G$ ELSE A$=A$&E$
1070 GOTO 1090
1080 IF S=96 THEN A$=A$&B$ ELSE IF S=104 THEN A$=A$&C$ ELSE A$=A$&D$
1090 NEXT K :: PRINT #1:TAB(@);CHR$(27);"K";CHR$(248);CHR$(0);A$;CHR$(10) :: NEXT I
1100 PRINT #1:TAB(@);GR$&B$;"=PHYSICAL CYCLE";CHR$(10);TAB(@);GR$&C$;"=EMOTIONAL CYCLE";CHR$(10);TAB(@);GR$&D$;"=INTELLECTUAL CYCLE";CHR$(10)
1110 PRINT #1:TAB(@);GR$&H$;"=COINCIDENCE";CHR$(10)
1120 PRINT #1:TAB(@);"AVERAGE OF CYCLES:";SEG$(STR$((SIN(PI/180*360*DL/23)+SIN(PI/180*360*DL/28)+SIN(PI/180*360*DL/33))/3),1,7);CHR$(13)
1130 IF PR=1 THEN IF LFY/2=INT(LFY/2)THEN PRINT #1:CHR$(12)ELSE PRINT #1:RPT$(CHR$(10),5)
1140 CLOSE #1 :: IF PR<>1 THEN 910
1150 NEXT LFY :: PR=0 :: GOTO 910
1160 SUB GRAPH(A,B)
1170 FOR Y=2 TO 32 :: X=INT(SIN(PI/180*360*(B+Y-16)/A)*-6)+12
1180 CALL GCHAR(X,Y,C) :: IF C>95 THEN CALL SOUND(100,999,0) :: CALL VCHAR(X,Y,120)ELSE CALL VCHAR(X,Y,(A-23)/5*8+96)
1190 NEXT Y
1200 SUBEND

 

 

 

‘@’ is the ASCII character just before ‘A’ and is a perfectly good character for an XB variable name and that is the name of the variable you note, whether or not it looks like ‘@’, that is an artifact of the font in use.

 

...lee

Share this post


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

Did you receive an error? It looks legit, it relates to the printer, so I suppose you need to test the command. I don't have a printer to test it with... 😢

Nope, it works! But do test the screen ver.

Share this post


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

 

‘@’ is the ASCII character just before ‘A’ and is a perfectly good character for an XB variable name and that is the name of the variable you note, whether or not it looks like ‘@’, that is an artifact of the font in use.

 

...lee

Thx!

  • Like 1

Share this post


Link to post
Share on other sites

Target!
Found this in a magazine (here in Atariage) The code is changed in the graphic dep. Original listing is in the pic.

Problems... Bomb is not displayed! Been reading and re-reading. Changing and I have not gotten anywhere... Need "new eyes" on this. Can you help me?
Also building explosion is now gone... too MUCH fixing :p hehehe

 

Spoiler
100 REM ***TX SOFTWARE***
110 REM R.MATTHENS (1982)
120 REM *****************
130 DIM A(32) :: A(1),A(2),A(3),A(31),A(30),A(31),A(32)=25
140 RANDOMIZE :: CALL MAGNIFY(3) :: CALL COLOR(9,2,6,11,1,5,13,1,1)
145 CALL SCREEN(6) :: CALL INSTRUCTIONS(PN)
149 REM PLANE
150 A1$="0080C0FFFFFF1E78"&RPT$("0",22)&"F8FEFE8000000000"
159 REM TANK
160 A2$="000000030F1F1F077FFFFF7F2A3F000000000000C0FFC080FCFEFEFCA8F80000"
169 REM ROAD
170 A3$="FFFF"
179 REM TANK EXPLOSIONS 1(ANIM) START
180 A4$=RPT$("0",16)&"293A6FDABF754F3D"&RPT$("0",16)&"0E0D5BEDDF7AEF1C"
189 REM TANK EXPLOSIONS 2(ANIM) BIG
190 A5$="291B7DD7BF7B6F3D0F07030303070F7F8060F5D5BFFFFADEFA1C1818181C1EFF"
199 REM EXPLOSIONS BUILDING
200 A6$="34599544B5AE78AF7AD77EB7CA425149"
209 REM BOMB
210 A7$="E040404000000000"
219 REM RIGHT SIDE HOUSE
220 A8$="7F7F66667F7F6666"
229 REM LEFT SIDE HOUSE
230 A9$="FEFE6666FEFE6666"
234 REM ASIGN CHAR TO Ax$
235 CALL CHAR(96,A1$,108,A2$,112,A3$,116,A4$,120,A5$)
236 CALL CHAR(124,A6$,104,A7$,132,A8$,128,A9$)
240 REM SETTING HEIGHT :: CALL CLEAR :: FOR J=4 TO 28 STEP 2 :: HT=INT(RND*10)+1
245 REM DRAWING HOUSES :: CALL VCHAR(24-HT,J,132,HT) :: CALL VCHAR(24-HT,J+1,128,HT)
250 A(J),A(J+1)=24-HT :: NEXT J :: CALL COLOR(13,2,6) :: CALL HCHAR(24,1,112,32)
260 CALL SPRITE(#2,96,5,10,1,0,35) :: REM #2=PLANE
265 CALL SPRITE(#4,108,16,178,100,0,5,#5,108,11,178,20,0,5) :: REM #4 and #5=TANK 1-2
266 CALL SPRITE(#6,108,12,178,180,0,5) :: REM #6=TANK 3
270 CALL KEY(1,K,S) :: IF S THEN GOSUB 280 ELSE SC=SC-PN :: REM "RED BUTTON" DROP BOMB
271 GOTO 270
280 CALL POSITION(#2,X,Y) :: CALL LOCATE(#2,X+1,Y) :: REM WHERE IS THE PLANE
285 CALL SPRITE(#3,104,16,X,Y,50,0) :: CL=INT(Y/8.01)+1 :: X1=INT(X/8.01)+3 :: REM BOMB
290 IF CL<4 OR CL>30 THEN 330
300 CALL COINC(ALL,C) :: IF C THEN 360 ELSE CALL POSITION(#3,X,Y)
305 IF X>184 THEN 330 ELSE RW=INT(X/8.01)+1 :: IF RW<A(CL) THEN 300
310 CALL SPRITE(#3,124,2,X,Y,-20,0) :: CALL SOUND(-200,-5,0)
315 CALL VCHAR(RW-2,CL,32,3) :: A(CL)=RW+1
320 SC=SC+10 :: DISPLAY AT(1,1):SC
330 CALL DELSPRITE(#3) :: IF X1<16 THEN RETURN :: REM DELETE BOMB, RETURN TO "RED BUTTON"
340 FOR J=4 TO 29 :: IF A(J)<X1 THEN 380
350 NEXT J :: RETURN
360 CALL SPRITE(#3,116,16,176,Y,0,0) :: CALL SOUND(-560,-5,0)
365 SC=SC+(75-RW)*4 :: DISPLAY AT(1,1):SC
370 CALL PATTERN(#3,120) :: IF RND<.5 THEN 360 ELSE 330
380 CALL SOUND(-4000,-3,0,400,0)
385 FOR DEL=1 TO 1500 :: NEXT DEL :: RUN
390 STOP
400 SUB INSTRUCTIONS(PN) :: CALL CLEAR
410 DISPLAY AT(1,8):"TARGET" :: DISPLAY AT(2,8):"======"
420 DISPLAY AT(5,1):"USE ANY KEY TO DROP BOMB."
430 DISPLAY AT(9,1):"CHOOSE OPTION PLEASE"
440 DISPLAY AT(13,1):"EASY OPTION";TAB(26);"(1)"
450 DISPLAY AT(15,1):"HARD OPTION"
460 DISPLAY AT(16,1):"NEGATIVE SCORINGS";TAB(26);"(2)"
470 CALL KEY(0,KY,ST) :: CALL SOUND(-20,900,20) :: IF ST=0 THEN 470
480 IF KY=49 OR KY=50 THEN PN=KY-49 ELSE 470
500 SUBEND

600 REM *******
601 REM LINES 150 TO 210 DEFINE CHARACTERS .. EXPERIMENT HERE!
610 REM A1$................ PLANE
620 REM A2$................ TANKS
630 REM A3$................ ROAD
640 REM A4$,A5$,A6$........ EXPLOSIONS
650 REM A7$................ BOMB
660 REM A8$,A9$............ BUILDINGS
670 REM *******
680 REM SPRITE #2...........PLANE
690 REM SPRITES #4,#5,#6... TANKS
700 REM SPRITE #3.......... BOMB
710 REM *******
720 REM INCREASE DIFFICULTY LEVEL BY INCREASING SPEED OF SPRITE(#2)
725 REM ALSO HEIGHT OF BUILDIWGS CAH BE CHANHGED IN LINE 240
726 REM TANKS CAH BE SPEEDED UP ORF SLOWED DOWN IN LINES 265 AND 266
730 REM ARRAY "A()" KEEPS CHECK OF HEIGHT OF EACH BUILDING
740 REM AS AN ALTERNATIVE TO "RUN" IN 385 YOU CAN CHECK FOR HIGHEST SCORE TO
750 REM DATE ..HIGHEST=MAX(SC,HIGHEST) AND GOTO 246 . HIGHEST SCORE CAN THEN
760 REM BE DISPLAYED
800 REM ALL REMS MAY BE DELETED

801 REM PLAYING AROUND – OLD/ORIGINAL STUFF
802 REM EXPLOSIONS 80E0F5FEFFFFFFF1C
803 REM 293B7FFFFF7F7F3F0F07030303070F7F80E0F5F5FFFFFEFEFE1C1818181C1EFF
804 REM 34599D45B5AC7CBF7EFF7EFFCA425149
805 REM A1$="0080C0FFFFFF3F78"&RPT$("0",22)&"FCFEFE8000000000"
900 END

 

 

cvgJan83_target_bb_REN.jpg

Share this post


Link to post
Share on other sites
2 hours ago, oddemann said:

Target!
Found this in a magazine (here in Atariage) The code is changed in the graphic dep. Original listing is in the pic.

Problems... Bomb is not displayed! Been reading and re-reading. Changing and I have not gotten anywhere... Need "new eyes" on this. Can you help me?
Also building explosion is now gone... too MUCH fixing 😛 hehehe

 

I have not looked at this very carefully yet, but this struck me as odd:  Perhaps it was intentional, but the REM at the beginning of lines 240 and 245 makes the entire line a comment. The ‘::’ after the REM part does not render the rest of the line executable. You should put the REM on a line by itself or use tail comments that start with ‘!’ at the end of an executable line.

 

...lee

  • Like 2

Share this post


Link to post
Share on other sites

Here is your program with the comments fixed:

Spoiler
100 REM ***TX SOFTWARE***
110 REM R.MATTHENS (1982)
120 REM *****************
130 DIM A(32) :: A(1),A(2),A(3),A(31),A(30),A(31),A(32)=25
140 RANDOMIZE :: CALL MAGNIFY(3) :: CALL COLOR(9,2,6,11,1,5,13,1,1)
145 CALL SCREEN(6) :: CALL INSTRUCTIONS(PN)
149 REM PLANE
150 A1$="0080C0FFFFFF1E78"&RPT$("0",22)&"F8FEFE8000000000"
159 REM TANK
160 A2$="000000030F1F1F077FFFFF7F2A3F000000000000C0FFC080FCFEFEFCA8F80000"
169 REM ROAD
170 A3$="FFFF"
179 REM TANK EXPLOSIONS 1(ANIM) START
180 A4$=RPT$("0",16)&"293A6FDABF754F3D"&RPT$("0",16)&"0E0D5BEDDF7AEF1C"
189 REM TANK EXPLOSIONS 2(ANIM) BIG
190 A5$="291B7DD7BF7B6F3D0F07030303070F7F8060F5D5BFFFFADEFA1C1818181C1EFF"
199 REM EXPLOSIONS BUILDING
200 A6$="34599544B5AE78AF7AD77EB7CA425149"
209 REM BOMB
210 A7$="E040404000000000"
219 REM RIGHT SIDE HOUSE
220 A8$="7F7F66667F7F6666"
229 REM LEFT SIDE HOUSE
230 A9$="FEFE6666FEFE6666"
234 REM ASIGN CHAR TO Ax$
235 CALL CHAR(96,A1$,108,A2$,112,A3$,116,A4$,120,A5$)
236 CALL CHAR(124,A6$,104,A7$,132,A8$,128,A9$)
240 CALL CLEAR :: FOR J=4 TO 28 STEP 2 :: HT=INT(RND*10)+1 !SETTING HEIGHT
245 CALL VCHAR(24-HT,J,132,HT) :: CALL VCHAR(24-HT,J+1,128,HT) !DRAWING HOUSES
250 A(J),A(J+1)=24-HT :: NEXT J :: CALL COLOR(13,2,6) :: CALL HCHAR(24,1,112,32)
260 CALL SPRITE(#2,96,5,10,1,0,35) !#2=PLANE
265 CALL SPRITE(#4,108,16,178,100,0,5,#5,108,11,178,20,0,5) !#4 and #5=TANK 1-2
266 CALL SPRITE(#6,108,12,178,180,0,5) !#6=TANK 3
270 CALL KEY(1,K,S) :: IF S THEN GOSUB 280 ELSE SC=SC-PN !"RED BUTTON" DROP BOMB
271 GOTO 270
280 CALL POSITION(#2,X,Y) :: CALL LOCATE(#2,X+1,Y) !WHERE IS THE PLANE
285 CALL SPRITE(#3,104,16,X,Y,50,0) :: CL=INT(Y/8.01)+1 :: X1=INT(X/8.01)+3 !BOMB
290 IF CL<4 OR CL>30 THEN 330
300 CALL COINC(ALL,C) :: IF C THEN 360 ELSE CALL POSITION(#3,X,Y)
305 IF X>184 THEN 330 ELSE RW=INT(X/8.01)+1 :: IF RW<A(CL) THEN 300
310 CALL SPRITE(#3,124,2,X,Y,-20,0) :: CALL SOUND(-200,-5,0)
315 CALL VCHAR(RW-2,CL,32,3) :: A(CL)=RW+1
320 SC=SC+10 :: DISPLAY AT(1,1):SC
330 CALL DELSPRITE(#3) :: IF X1<16 THEN RETURN !DELETE BOMB, RETURN TO "RED BUTTON"
340 FOR J=4 TO 29 :: IF A(J)<X1 THEN 380
350 NEXT J :: RETURN
360 CALL SPRITE(#3,116,16,176,Y,0,0) :: CALL SOUND(-560,-5,0)
365 SC=SC+(75-RW)*4 :: DISPLAY AT(1,1):SC
370 CALL PATTERN(#3,120) :: IF RND<.5 THEN 360 ELSE 330
380 CALL SOUND(-4000,-3,0,400,0)
385 FOR DEL=1 TO 1500 :: NEXT DEL :: RUN
390 STOP
400 SUB INSTRUCTIONS(PN) :: CALL CLEAR
410 DISPLAY AT(1,8):"TARGET" :: DISPLAY AT(2,8):"======"
420 DISPLAY AT(5,1):"USE ANY KEY TO DROP BOMB."
430 DISPLAY AT(9,1):"CHOOSE OPTION PLEASE"
440 DISPLAY AT(13,1):"EASY OPTION";TAB(26);"(1)"
450 DISPLAY AT(15,1):"HARD OPTION"
460 DISPLAY AT(16,1):"NEGATIVE SCORINGS";TAB(26);"(2)"
470 CALL KEY(0,KY,ST) :: CALL SOUND(-20,900,20) :: IF ST=0 THEN 470
480 IF KY=49 OR KY=50 THEN PN=KY-49 ELSE 470
500 SUBEND

600 REM *******
601 REM LINES 150 TO 210 DEFINE CHARACTERS .. EXPERIMENT HERE!
610 REM A1$................ PLANE
620 REM A2$................ TANKS
630 REM A3$................ ROAD
640 REM A4$,A5$,A6$........ EXPLOSIONS
650 REM A7$................ BOMB
660 REM A8$,A9$............ BUILDINGS
670 REM *******
680 REM SPRITE #2...........PLANE
690 REM SPRITES #4,#5,#6... TANKS
700 REM SPRITE #3.......... BOMB
710 REM *******
720 REM INCREASE DIFFICULTY LEVEL BY INCREASING SPEED OF SPRITE(#2)
725 REM ALSO HEIGHT OF BUILDIWGS CAH BE CHANHGED IN LINE 240
726 REM TANKS CAH BE SPEEDED UP ORF SLOWED DOWN IN LINES 265 AND 266
730 REM ARRAY "A()" KEEPS CHECK OF HEIGHT OF EACH BUILDING
740 REM AS AN ALTERNATIVE TO "RUN" IN 385 YOU CAN CHECK FOR HIGHEST SCORE TO
750 REM DATE ..HIGHEST=MAX(SC,HIGHEST) AND GOTO 246 . HIGHEST SCORE CAN THEN
760 REM BE DISPLAYED
800 REM ALL REMS MAY BE DELETED

801 REM PLAYING AROUND - OLD/ORIGINAL STUFF
802 REM EXPLOSIONS 80E0F5FEFFFFFFF1C
803 REM 293B7FFFFF7F7F3F0F07030303070F7F80E0F5F5FFFFFEFEFE1C1818181C1EFF
804 REM 34599D45B5AC7CBF7EFF7EFFCA425149
805 REM A1$="0080C0FFFFFF3F78"&RPT$("0",22)&"FCFEFE8000000000"
900 END

 

Look at lines 240 and 245, particularly.

 

...lee

  • Like 2

Share this post


Link to post
Share on other sites

Here is the same program with each REM referring to a single line of code moved, as a tail comment, to the end of the relevant line. This leaves the line-234 REM intact as the only REM referring to more than one line:

Spoiler
100 REM ***TX SOFTWARE***
110 REM R.MATTHENS (1982)
120 REM *****************
130 DIM A(32) :: A(1),A(2),A(3),A(31),A(30),A(31),A(32)=25
140 RANDOMIZE :: CALL MAGNIFY(3) :: CALL COLOR(9,2,6,11,1,5,13,1,1)
145 CALL SCREEN(6) :: CALL INSTRUCTIONS(PN)
150 A1$="0080C0FFFFFF1E78"&RPT$("0",22)&"F8FEFE8000000000" !PLANE
160 A2$="000000030F1F1F077FFFFF7F2A3F000000000000C0FFC080FCFEFEFCA8F80000" !TANK
170 A3$="FFFF" !ROAD
180 A4$=RPT$("0",16)&"293A6FDABF754F3D"&RPT$("0",16)&"0E0D5BEDDF7AEF1C" !TANK EXPLOSIONS 1(ANIM) START
190 A5$="291B7DD7BF7B6F3D0F07030303070F7F8060F5D5BFFFFADEFA1C1818181C1EFF" !TANK EXPLOSIONS 2(ANIM) BIG
200 A6$="34599544B5AE78AF7AD77EB7CA425149" !EXPLOSIONS BUILDING
210 A7$="E040404000000000" !BOMB
220 A8$="7F7F66667F7F6666" !RIGHT SIDE HOUSE
230 A9$="FEFE6666FEFE6666" !LEFT SIDE HOUSE
234 REM ASIGN CHAR TO Ax$
235 CALL CHAR(96,A1$,108,A2$,112,A3$,116,A4$,120,A5$)
236 CALL CHAR(124,A6$,104,A7$,132,A8$,128,A9$)
240 CALL CLEAR :: FOR J=4 TO 28 STEP 2 :: HT=INT(RND*10)+1 !SETTING HEIGHT
245 CALL VCHAR(24-HT,J,132,HT) :: CALL VCHAR(24-HT,J+1,128,HT) !DRAWING HOUSES
250 A(J),A(J+1)=24-HT :: NEXT J :: CALL COLOR(13,2,6) :: CALL HCHAR(24,1,112,32)
260 CALL SPRITE(#2,96,5,10,1,0,35) !#2=PLANE
265 CALL SPRITE(#4,108,16,178,100,0,5,#5,108,11,178,20,0,5) !#4 and #5=TANK 1-2
266 CALL SPRITE(#6,108,12,178,180,0,5) !#6=TANK 3
270 CALL KEY(1,K,S) :: IF S THEN GOSUB 280 ELSE SC=SC-PN !"RED BUTTON" DROP BOMB
271 GOTO 270
280 CALL POSITION(#2,X,Y) :: CALL LOCATE(#2,X+1,Y) !WHERE IS THE PLANE
285 CALL SPRITE(#3,104,16,X,Y,50,0) :: CL=INT(Y/8.01)+1 :: X1=INT(X/8.01)+3 !BOMB
290 IF CL<4 OR CL>30 THEN 330
300 CALL COINC(ALL,C) :: IF C THEN 360 ELSE CALL POSITION(#3,X,Y)
305 IF X>184 THEN 330 ELSE RW=INT(X/8.01)+1 :: IF RW<A(CL) THEN 300
310 CALL SPRITE(#3,124,2,X,Y,-20,0) :: CALL SOUND(-200,-5,0)
315 CALL VCHAR(RW-2,CL,32,3) :: A(CL)=RW+1
320 SC=SC+10 :: DISPLAY AT(1,1):SC
330 CALL DELSPRITE(#3) :: IF X1<16 THEN RETURN !DELETE BOMB, RETURN TO "RED BUTTON"
340 FOR J=4 TO 29 :: IF A(J)<X1 THEN 380
350 NEXT J :: RETURN
360 CALL SPRITE(#3,116,16,176,Y,0,0) :: CALL SOUND(-560,-5,0)
365 SC=SC+(75-RW)*4 :: DISPLAY AT(1,1):SC
370 CALL PATTERN(#3,120) :: IF RND<.5 THEN 360 ELSE 330
380 CALL SOUND(-4000,-3,0,400,0)
385 FOR DEL=1 TO 1500 :: NEXT DEL :: RUN
390 STOP
400 SUB INSTRUCTIONS(PN) :: CALL CLEAR
410 DISPLAY AT(1,8):"TARGET" :: DISPLAY AT(2,8):"======"
420 DISPLAY AT(5,1):"USE ANY KEY TO DROP BOMB."
430 DISPLAY AT(9,1):"CHOOSE OPTION PLEASE"
440 DISPLAY AT(13,1):"EASY OPTION";TAB(26);"(1)"
450 DISPLAY AT(15,1):"HARD OPTION"
460 DISPLAY AT(16,1):"NEGATIVE SCORINGS";TAB(26);"(2)"
470 CALL KEY(0,KY,ST) :: CALL SOUND(-20,900,20) :: IF ST=0 THEN 470
480 IF KY=49 OR KY=50 THEN PN=KY-49 ELSE 470
500 SUBEND

600 REM *******
601 REM LINES 150 TO 210 DEFINE CHARACTERS .. EXPERIMENT HERE!
610 REM A1$................ PLANE
620 REM A2$................ TANKS
630 REM A3$................ ROAD
640 REM A4$,A5$,A6$........ EXPLOSIONS
650 REM A7$................ BOMB
660 REM A8$,A9$............ BUILDINGS
670 REM *******
680 REM SPRITE #2...........PLANE
690 REM SPRITES #4,#5,#6... TANKS
700 REM SPRITE #3.......... BOMB
710 REM *******
720 REM INCREASE DIFFICULTY LEVEL BY INCREASING SPEED OF SPRITE(#2)
725 REM ALSO HEIGHT OF BUILDIWGS CAH BE CHANHGED IN LINE 240
726 REM TANKS CAH BE SPEEDED UP ORF SLOWED DOWN IN LINES 265 AND 266
730 REM ARRAY "A()" KEEPS CHECK OF HEIGHT OF EACH BUILDING
740 REM AS AN ALTERNATIVE TO "RUN" IN 385 YOU CAN CHECK FOR HIGHEST SCORE TO
750 REM DATE ..HIGHEST=MAX(SC,HIGHEST) AND GOTO 246 . HIGHEST SCORE CAN THEN
760 REM BE DISPLAYED
800 REM ALL REMS MAY BE DELETED

801 REM PLAYING AROUND - OLD/ORIGINAL STUFF
802 REM EXPLOSIONS 80E0F5FEFFFFFFF1C
803 REM 293B7FFFFF7F7F3F0F07030303070F7F80E0F5F5FFFFFEFEFE1C1818181C1EFF
804 REM 34599D45B5AC7CBF7EFF7EFFCA425149
805 REM A1$="0080C0FFFFFF3F78"&RPT$("0",22)&"FCFEFE8000000000"
900 END

 

Of course, you can safely ignore my gratuitous REM changes🙂—just keep the ones for lines 240 and 245. 

 

...lee

  • Like 1

Share this post


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

Here is the same program with each REM referring to a single line of code moved, as a tail comment, to the end of the relevant line. This leaves the line-234 REM intact as the only REM referring to more than one line:

  Reveal hidden contents

100 REM ***TX SOFTWARE***
110 REM R.MATTHENS (1982)
120 REM *****************
130 DIM A(32) :: A(1),A(2),A(3),A(31),A(30),A(31),A(32)=25
140 RANDOMIZE :: CALL MAGNIFY(3) :: CALL COLOR(9,2,6,11,1,5,13,1,1)
145 CALL SCREEN(6) :: CALL INSTRUCTIONS(PN)
150 A1$="0080C0FFFFFF1E78"&RPT$("0",22)&"F8FEFE8000000000" !PLANE
160 A2$="000000030F1F1F077FFFFF7F2A3F000000000000C0FFC080FCFEFEFCA8F80000" !TANK
170 A3$="FFFF" !ROAD
180 A4$=RPT$("0",16)&"293A6FDABF754F3D"&RPT$("0",16)&"0E0D5BEDDF7AEF1C" !TANK EXPLOSIONS 1(ANIM) START
190 A5$="291B7DD7BF7B6F3D0F07030303070F7F8060F5D5BFFFFADEFA1C1818181C1EFF" !TANK EXPLOSIONS 2(ANIM) BIG
200 A6$="34599544B5AE78AF7AD77EB7CA425149" !EXPLOSIONS BUILDING
210 A7$="E040404000000000" !BOMB
220 A8$="7F7F66667F7F6666" !RIGHT SIDE HOUSE
230 A9$="FEFE6666FEFE6666" !LEFT SIDE HOUSE
234 REM ASIGN CHAR TO Ax$
235 CALL CHAR(96,A1$,108,A2$,112,A3$,116,A4$,120,A5$)
236 CALL CHAR(124,A6$,104,A7$,132,A8$,128,A9$)
240 CALL CLEAR :: FOR J=4 TO 28 STEP 2 :: HT=INT(RND*10)+1 !SETTING HEIGHT
245 CALL VCHAR(24-HT,J,132,HT) :: CALL VCHAR(24-HT,J+1,128,HT) !DRAWING HOUSES
250 A(J),A(J+1)=24-HT :: NEXT J :: CALL COLOR(13,2,6) :: CALL HCHAR(24,1,112,32)
260 CALL SPRITE(#2,96,5,10,1,0,35) !#2=PLANE
265 CALL SPRITE(#4,108,16,178,100,0,5,#5,108,11,178,20,0,5) !#4 and #5=TANK 1-2
266 CALL SPRITE(#6,108,12,178,180,0,5) !#6=TANK 3
270 CALL KEY(1,K,S) :: IF S THEN GOSUB 280 ELSE SC=SC-PN !"RED BUTTON" DROP BOMB
271 GOTO 270
280 CALL POSITION(#2,X,Y) :: CALL LOCATE(#2,X+1,Y) !WHERE IS THE PLANE
285 CALL SPRITE(#3,104,16,X,Y,50,0) :: CL=INT(Y/8.01)+1 :: X1=INT(X/8.01)+3 !BOMB
290 IF CL<4 OR CL>30 THEN 330
300 CALL COINC(ALL,C) :: IF C THEN 360 ELSE CALL POSITION(#3,X,Y)
305 IF X>184 THEN 330 ELSE RW=INT(X/8.01)+1 :: IF RW<A(CL) THEN 300
310 CALL SPRITE(#3,124,2,X,Y,-20,0) :: CALL SOUND(-200,-5,0)
315 CALL VCHAR(RW-2,CL,32,3) :: A(CL)=RW+1
320 SC=SC+10 :: DISPLAY AT(1,1):SC
330 CALL DELSPRITE(#3) :: IF X1<16 THEN RETURN !DELETE BOMB, RETURN TO "RED BUTTON"
340 FOR J=4 TO 29 :: IF A(J)<X1 THEN 380
350 NEXT J :: RETURN
360 CALL SPRITE(#3,116,16,176,Y,0,0) :: CALL SOUND(-560,-5,0)
365 SC=SC+(75-RW)*4 :: DISPLAY AT(1,1):SC
370 CALL PATTERN(#3,120) :: IF RND<.5 THEN 360 ELSE 330
380 CALL SOUND(-4000,-3,0,400,0)
385 FOR DEL=1 TO 1500 :: NEXT DEL :: RUN
390 STOP
400 SUB INSTRUCTIONS(PN) :: CALL CLEAR
410 DISPLAY AT(1,8):"TARGET" :: DISPLAY AT(2,8):"======"
420 DISPLAY AT(5,1):"USE ANY KEY TO DROP BOMB."
430 DISPLAY AT(9,1):"CHOOSE OPTION PLEASE"
440 DISPLAY AT(13,1):"EASY OPTION";TAB(26);"(1)"
450 DISPLAY AT(15,1):"HARD OPTION"
460 DISPLAY AT(16,1):"NEGATIVE SCORINGS";TAB(26);"(2)"
470 CALL KEY(0,KY,ST) :: CALL SOUND(-20,900,20) :: IF ST=0 THEN 470
480 IF KY=49 OR KY=50 THEN PN=KY-49 ELSE 470
500 SUBEND

600 REM *******
601 REM LINES 150 TO 210 DEFINE CHARACTERS .. EXPERIMENT HERE!
610 REM A1$................ PLANE
620 REM A2$................ TANKS
630 REM A3$................ ROAD
640 REM A4$,A5$,A6$........ EXPLOSIONS
650 REM A7$................ BOMB
660 REM A8$,A9$............ BUILDINGS
670 REM *******
680 REM SPRITE #2...........PLANE
690 REM SPRITES #4,#5,#6... TANKS
700 REM SPRITE #3.......... BOMB
710 REM *******
720 REM INCREASE DIFFICULTY LEVEL BY INCREASING SPEED OF SPRITE(#2)
725 REM ALSO HEIGHT OF BUILDIWGS CAH BE CHANHGED IN LINE 240
726 REM TANKS CAH BE SPEEDED UP ORF SLOWED DOWN IN LINES 265 AND 266
730 REM ARRAY "A()" KEEPS CHECK OF HEIGHT OF EACH BUILDING
740 REM AS AN ALTERNATIVE TO "RUN" IN 385 YOU CAN CHECK FOR HIGHEST SCORE TO
750 REM DATE ..HIGHEST=MAX(SC,HIGHEST) AND GOTO 246 . HIGHEST SCORE CAN THEN
760 REM BE DISPLAYED
800 REM ALL REMS MAY BE DELETED

801 REM PLAYING AROUND - OLD/ORIGINAL STUFF
802 REM EXPLOSIONS 80E0F5FEFFFFFFF1C
803 REM 293B7FFFFF7F7F3F0F07030303070F7F80E0F5F5FFFFFEFEFE1C1818181C1EFF
804 REM 34599D45B5AC7CBF7EFF7EFFCA425149
805 REM A1$="0080C0FFFFFF3F78"&RPT$("0",22)&"FCFEFE8000000000"
900 END

 

Of course, you can safely ignore my gratuitous REM changes🙂—just keep the ones for lines 240 and 245. 

 

...lee

The REM is added after trying a good deal of different stuff. So in a last try to understand it as I was reading the code, I added that. Was doing TRACE to see what the TI was doing, and then I added the REM in my doc.

Thx, for that, Lee! Then I save space in lines and I can add comments ;) Seen it, did not know how it worked. But now I know.

But I did not have REM in anything as I was trying to get it to work.

  • Like 2

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.

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...