Compucolor.org – Virtual Media

Listing of file='WORDER.BAS;01' on disk='vmedia/chip_125-sector.ccvf'

100 GOTO 11000
110 REM  LOOK FOR REMARK LINES AT LINE 2000
120 A$= "":L1= 0:REM  GENERAL INPUT SUBROUTINE.
130 POKE KB,0
140 A= PEEK (KB):IF A= 0THEN 140
150 IF A= 13THEN PRINT :RETURN
160 IF A= 26OR A= 127THEN 260
170 IF L1= LATHEN 130
180 IF NU= 1AND A> 47AND A< 58THEN 240
190 IF LU= 1AND A> 64AND A< 91THEN 240
200 IF PU= 1AND A> 31AND A< 48THEN 240
210 IF PU= 1AND A> 57AND A< 65THEN 240
220 IF PU= 1AND A> 90AND A< 97THEN 240
230 GOTO 130
240 A$= A$+ CHR$ (A):PRINT CHR$ (A);
250 L1= L1+ 1:GOTO 130
260 IF L1= 0THEN 130
270 PRINT " ";
280 IF L1= 1THEN 120
290 L1= L1- 1:A$= LEFT$ (A$,L1):GOTO 130
300 REM  SUBROUTINE FOR Y OR N ANSWERS.
310 POKE KB,0
320 A= PEEK (KB):IF A< 78THEN 320
330 IF A= 78THEN Y$= "N":RETURN
340 IF A= 89THEN Y$= "Y":RETURN
350 GOTO 310
400 REM  FIRST TWO LETTERS AND DIRECTION DISCOVERED, NOW
410 REM  CHECK TO SEE IF ALL CORRECT LETTERS ARE FOUND THERE.
420 FA= 1:REM  SET FOUND ALL LETTERS FLAG ON
430 FOR X= 3TO L1
440 IF A$(J+ ((X- 1)* J1),I+ ((X- 1)* I1))= SM$(X)THEN 460
450 X= L1:FA= 0:REM  NOT ALL LETTERS FOUND.
460 NEXT X:IF FA= 0THEN 510
470 FOR X= 1TO L1:REM  SET LETTERS TO YELLOW FOR PRINTING.
480 I3= I+ ((X- 1)* I1):J3= J+ ((X- 1)* J1)
490 B$(J3,I3)= CY$+ A$(J3,I3):C$(J3,I3)= B$(J3,I3)
500 NEXT
510 RETURN
600 REM  SCAN WORD BLOCK FOR WORD
610 FOR I= 1TO L1
620 SM$(I)= MID$ (A$,I,1)
630 NEXT
640 X1$= SM$(1):X2$= SM$(2):REM  START WITH FIRST TWO LETTERS
650 PLOT 3,0,YM+ 2,11
660 PRINT "   WORKING ";
670 FOR I= 1TO YM
680 PRINT ".";
690 FOR J= 1TO XM
700 FA= 0
710 IF X1$< > A$(J,I)THEN 870
720 MI= - 1:PI= 1:MJ= - 1:PJ= 1:REM  SEARCHING DIRECTIONS. M=MINUS
730 IF I< L1THEN MI= 0:REM  P=PLUS
740 IF I+ L1> YM+ 1THEN PI= 0
750 IF J< L1THEN MJ= 0
760 IF J+ L1> XM+ 1THEN PJ= 0
770 IF ABS (MI)+ PI+ ABS (MJ)+ PJ< 1THEN 870
780 FOR I1= MITO PI
790 FOR J1= MJTO PJ
800 IF I1= 0AND J1= 0THEN 840
810 IF A$(J+ J1,I+ I1)< > X2$THEN 840
820 GOSUB 420:REM  FIND OUT IF REST OF WORD IS THERE.
830 IF FA= 1THEN J2= J1:J1= 1:I2= I1:I1= 1
840 NEXT J1
850 NEXT I1
860 IF FA= 1THEN SI= I:SJ= J:I= YM:J= XM:J1= J2:I1= I2
870 NEXT J
880 NEXT I
890 PRINT
900 REM  PRINT OUT LETTER BLOCKS.
910 PLOT 6,1,12,15,29,13,13
920 PRINT "     MOST RECENT WORD                ALL WORDS DISCOVERED"
930 PLOT 6,6
940 FOR I= 1TO YM
950 FOR J= 1TO XM
960 PRINT TAB( 5);B$(J,I);
970 NEXT
980 FOR J= 1TO XM
990 PRINT TAB( 37);C$(J,I);
1000 NEXT
1010 PRINT
1020 NEXT
1030 IF FA= 0THEN 1100:REM  DON'T BOTHER TURNING OFF COLORS IF
1040 REM                THEY WERE NEVER SET IN THE FIRST PLACE.
1050 REM  RESET COLOR TO CYAN FOR BLOCK B$( ).
1060 FOR X= 1TO L1
1070 I3= SI+ ((X- 1)* I1):J3= SJ+ ((X- 1)* J1)
1080 B$(J3,I3)= CC$+ A$(J3,I3)
1090 NEXT
1100 RETURN
2000 REM
2010 REM        WORD FINDER
2020 REM
2030 REM    BY  JOHN R. BELL
2040 REM        8300 FOURTH AVENUE
2050 REM        NORTH BERGEN, NEW JERSEY  07047
2060 REM        201-861-8404
2070 REM
2080 REM  NOTE: FOR EXECUTION SPEED, MOST REMS ARE AT END.
2100 PLOT 27,24,6,6,14,29,12,13
2110 FILE "T",10000:REM  TURN ON FILE ERROR TRAPPING
2120 KB= 33278:REM  KEYBOARD LOCATION
2130 DATA  "IMPROPER FILE NAME!!! PLEASE RE-ENTER."
2140 DATA  "FILE NOT OPEN!!! TRY AGAIN."
2150 DATA  "FILE ALREAY OPEN!!! TRY ANOTHER ONE."
2160 DATA  "FILE TOO BIG. DO NOT RE-TRY."
2170 DATA  "ATTEMPTED TO READ OR WRITE TOO MUCH DATA. DO NOT RE-TRY."
2180 DATA  "ATTEMPTED TO READ OR WRITE TOO MANY RECORDS. DO NOT RE-TRY."
2190 DATA  "FILE DOES NOT EXIST ON THIS DISK. TRY ANOTHER DISK."
2200 DATA  "CANNOT CLOSE FILE. POSSIBLE DISK TROUBLE."
2210 DATA  "READ ERROR. DISK IS BAD."
2220 DATA  "WRITE ERROR. DISK IS BAD."
2230 DIM M$(10):REM  DISK ERROR MESSAGES.
2240 FOR I= 1TO 10:READ M$(I):NEXT
2300 PRINT TAB( 14);"A X U H Z W O R D E K O P M F O"
2310 PRINT TAB( 14);"B O I T J O H N L B V X I J D S"
2320 PRINT TAB( 14);"W O J O H N B H J L A K D U N W"
2330 PRINT TAB( 14);"G H F I N D E R H D B U R C E K"
2340 PRINT TAB( 14);"A B F E B E L L J H A E W X A K"
2350 PRINT TAB( 14);"Q S L E P R L D K V S O I D S W"
2360 PLOT 6,2,15,3,0,14,11
2370 PRINT "  INSTRUCTIONS? (Y/N) ";
2380 GOSUB 310:PRINT
2390 IF Y$= "N"THEN 3000
2400 REM  GIVE INSTRUCTIONS
2410 PRINT :PLOT 13,3,0,14,11,6,2
2420 PRINT " GIVEN A 'WORD BLOCK' LIKE THE ONE ABOVE, THIS PROGRAM WILL"
2430 PRINT " ASSIST YOU IN FINDING OUT THE LOCATIONS OF THE WORDS YOU GIVE"
2440 PRINT " IT. YOU HAVE THE OPTION OF LOADING IN A WORD BLOCK FROM DISK"
2450 PRINT " (IF ONE EXISTS), AND A LIST OF WORDS TO SEARCH. ANY BLOCK"
2460 PRINT " YOU ENTER OR MODIFY CAN BE SAVED TO DISK AND PRINTER, AS CAN"
2470 PRINT " THE WORD LISTS. ON THE SCREEN, TWO WORD BLOCKS ARE PRINTED"
2480 PRINT " OUT. THE FIRST ONE SHOWS JUST YOUR LAST WORD HIGHLIGHTED,"
2490 PRINT " THE SECOND BLOCK SHOWS ALL YOUR WORDS HIGHLIGHTED."
2500 PRINT " NOTE: THE PROGRAM MAY APPEAR TO 'HANG' IN SOME PLACES,"
2510 PRINT " BUT THAT IS JUST COMPUCOLOR'S SLOW 'GARBAGE COLLECTION'"
2520 PRINT " OF STRING SPACE. JUST BE PATIENT."
2530 PRINT "     HIT  RETURN  TO CONTINUE. ";
2540 POKE KB,0
2550 A= PEEK (KB):IF A< > 13THEN 2550
2560 PRINT
3000 REM  START PROGRAM
3010 PLOT 6,4,12,15,30
3020 PRINT :PRINT " t";:FOR I= 1TO 60:PRINT "e";:NEXT :PRINT "u"
3030 PRINT " a";TAB( 62);"b"
3040 PRINT " a RESTORE BLOCK FROM DISK:";TAB( 62);"b"
3050 PRINT " a FILE NAME:";TAB( 62);"b"
3060 PRINT " a VERSION:";TAB( 62);"b"
3070 PRINT " a";TAB( 62);"b"
3080 PRINT " a RESTORE A WORD LIST FROM DISK:";TAB( 62);"b"
3090 PRINT " a FILE NAME:";TAB( 62);"b"
3100 PRINT " a VERSION:";TAB( 62);"b"
3110 PRINT " a";TAB( 62);"b"
3120 PRINT " a HOW MANY CHARACTERS ACROSS? :";TAB( 62);"b"
3130 PRINT " a HOW MANY CHARACTERS  DOWN ? :";TAB( 62);"b"
3140 PRINT " a";TAB( 62);"b"
3150 PRINT " a ARE LETTERS USED? :";TAB( 62);"b"
3160 PRINT " a ARE NUMBERS USED? :";TAB( 62);"b"
3170 PRINT " a ARE SPACES, PUNCUATION USED? :";TAB( 62);"b"
3180 FOR I= 1TO 3:PRINT " a";TAB( 62);"b"
3190 PRINT " v";:FOR I= 1TO 60:PRINT "";:NEXT :PRINT "w"
3200 PRINT :PRINT
3210 PRINT "    FOR DEFAULT VALUES, PRESS  RETURN"
3500 REM  START GETTING ANSWERS
3510 PLOT 6,1,3,28,3
3520 PRINT "YES OR NO. --> ";
3530 GOSUB 310:RB$= Y$:PRINT
3540 IF Y$= "N"THEN 4200
3550 PLOT 3,31,3
3560 PRINT SPC( 15)
3600 PLOT 3,14,4
3610 PRINT "ENTER FILE NAME (DEFAULT= BLOCK) ";
3620 NU= 0:PU= 0:LU= 1:LA= 6:GOSUB 120
3630 IF A$= ""THEN A$= "BLOCK"
3640 FB$= A$+ ".RND"
3650 PLOT 3,14,4:PRINT FB$;SPC( 35):PRINT
3700 PLOT 3,12,5
3710 PRINT "ENTER VERSION # (DEFAULT= HIGHEST AVAILABLE) ";
3720 NU= 1:PU= 0:LU= 0:LA= 2:GOSUB 120
3730 IF A$= ""THEN A$= "XX":REM  PRINT OUT A DEFAULT VALUE.
3740 IF L1= 1THEN A$= "0"+ A$
3750 VB$= ";"+ A$:PLOT 3,12,5:PRINT VB$;SPC( 45):PRINT
3800 REM  READ A BLOCK FILE IN
3810 IF VB$= ";XX"THEN VB$= ""
3820 FI$= FB$+ VB$
3830 PLOT 6,65,14,3,0,26
3840 PRINT "   READING";
3850 FILE "R",1,FI$,7
3860 GET 1;XM,YM,LU$[1],NU$[1],PU$[1]
3870 PRINT ".";
3880 DIM Z$(YM)
3890 FOR I= 1TO YM
3900 GET 1;Z$(I)[XM]
3910 PRINT ".";
3920 NEXT
3930 FILE "C",1
3940 PRINT :PLOT 3,0,26,11,15
4000 PLOT 6,2,3,33,11:REM  FILL OUT REST OF FORM WITH ANSWERS
4010 PRINT XM:REM  OBTAINED FROM DISK FILE.
4020 PLOT 3,33,12
4030 PRINT YM
4040 PLOT 6,6,3,23,14
4050 IF LU$= "Y"THEN PRINT "YES"
4060 IF LU$= "N"THEN PRINT "NO"
4070 PLOT 3,23,15
4080 IF NU$= "Y"THEN PRINT "YES"
4090 IF NU$= "N"THEN PRINT "NO"
4100 PLOT 3,34,16
4110 IF PU$= "Y"THEN PRINT "YES"
4120 IF PU$= "N"THEN PRINT "NO"
4130 GOTO 4300
4200 PLOT 3,28,3
4210 PRINT "NO";SPC( 15)
4220 PLOT 3,14,4:PRINT "******"
4230 PLOT 3,12,5:PRINT "**"
4300 DIM WL$(100)
4400 PLOT 6,4,3,34,7
4410 PRINT "YES OR NO. --> ";
4420 GOSUB 310:RW$= Y$:PRINT
4430 IF Y$= "N"THEN 4900
4440 PLOT 3,37,7
4450 PRINT SPC( 15)
4500 PLOT 3,14,8
4510 PRINT "ENTER FILE NAME (DEFAULT= WORD) ";
4520 NU= 0:PU= 0:LU= 1:LA= 6:GOSUB 120
4530 IF A$= ""THEN A$= "WORD"
4540 FW$= A$+ ".RND"
4550 PLOT 3,14,8:PRINT FW$;SPC( 35):PRINT
4600 PLOT 3,12,9
4610 PRINT "ENTER VERSION # (DEFAULT= HIGHEST AVAILABLE) ";
4620 NU= 1:PU= 0:LU= 0:LA= 2:GOSUB 120
4630 IF A$= ""THEN A$= "XX"
4640 IF L1= 1THEN A$= "0"+ A$
4650 VW$= ";"+ A$:PLOT 3,12,9:PRINT VW$;SPC( 45):PRINT
4700 IF VW$= ";XX"THEN VW$= ""
4710 PLOT 6,65,14,3,8,26
4720 PRINT "READING";
4730 FI$= FW$+ VW$
4740 FILE "R",1,FI$,3
4750 PRINT ".";
4760 GET 1;WC
4770 FOR I= 1TO WC
4780 PRINT ".";
4790 GET 1;A$[28]
4800 X= 28
4810 FOR J= 1TO 28
4820 IF MID$ (A$,J,1)= " "THEN X= J- 1:J= 28
4830 NEXT
4840 WL$(I)= LEFT$ (A$,X)
4850 NEXT
4860 FILE "C",1
4870 PRINT
4880 PLOT 3,0,26,11
4890 GOTO 5000
4900 PLOT 3,34,7
4910 PRINT "NO";SPC( 15)
4920 PLOT 3,14,8:PRINT "******"
4930 PLOT 3,12,9:PRINT "**"
5000 IF RB$= "Y"THEN 6010
5100 PLOT 6,2,3,33,11
5110 PRINT "(7-28) ";
5120 LU= 0:PU= 0:NU= 1:LA= 2:GOSUB 120
5130 XM= VAL (A$)
5140 IF XM< 7OR XM> 28THEN PLOT 3,39,11:PRINT "   ":GOTO 5100
5150 PLOT 3,33,11:PRINT XM;SPC( 9):PRINT
5200 PLOT 3,33,12
5210 PRINT "(4-28) ";
5220 LU= 0:PU= 0:NU= 1:LA= 2:GOSUB 120
5230 YM= VAL (A$)
5240 IF YM< 4OR YM> 28THEN PLOT 3,39,12:PRINT "   ":GOTO 5200
5250 PLOT 3,33,12:PRINT YM;SPC( 9):PRINT
5300 PLOT 6,6,3,23,14
5310 PRINT "YES OR NO. --> ";
5320 GOSUB 310:LU$= Y$:PLOT 3,27,14
5330 IF Y$= "N"THEN PLOT 3,23,14:PRINT "NO";
5340 PRINT SPC( 15):PRINT
5400 PLOT 3,23,15
5410 PRINT "YES OR NO. --> ";
5420 GOSUB 310:NU$= Y$:PLOT 3,27,15
5430 IF Y$= "N"THEN PLOT 3,23,15:PRINT "NO";
5440 PRINT SPC( 15):PRINT
5500 PLOT 3,34,16
5510 PRINT "YES OR NO. --> ";
5520 GOSUB 310:PU$= Y$:PLOT 3,38,16
5530 IF Y$= "N"THEN PLOT 3,34,16:PRINT "NO";
5540 PRINT SPC( 15):PRINT
6000 DIM Z$(YM)
6010 LD= YM:IF XM> LDTHEN LD= XM:REM  DETERMINE LONGEST DIMENSION.
6020 CY$= "":CC$= ""
6030 DIM A$(XM,YM),B$(XM,YM),C$(XM,YM),SM$(LD)
6100 PLOT 6,7,15,12,13
6110 PRINT "    ENTER THE WORD BLOCK IN HORIZONTAL LINES."
6120 PRINT
6130 IF RB$= "Y"THEN 6500
6200 FOR I= 1TO YM
6210 PRINT " ENTER LINE";
6220 IF I< 10THEN PRINT " ";
6230 PRINT I;" --->";TAB( 19+ XM);"<---"
6240 NEXT
6300 LU= 0:NU= 0:PU= 0:LA= XM
6310 IF LU$= "Y"THEN LU= 1
6320 IF NU$= "Y"THEN NU= 1
6330 IF PU$= "Y"THEN PU= 1
6340 IF LU+ NU+ PU< 1THEN LU= 1
6400 PLOT 6,1
6410 FOR I= 1TO YM
6420 PLOT 3,19,1+ I
6430 GOSUB 120:IF L1< > XMTHEN PLOT 3,19,1+ I:PRINT SPC( XM):GOTO 6420
6440 Z$(I)= A$
6450 NEXT :GOTO 6600
6500 FOR I= 1TO YM
6510 PRINT " ENTER LINE";:IF I< 10THEN PRINT " ";
6520 PRINT I;" --->";Z$(I);"<---"
6530 NEXT
6600 PLOT 6,5,3,0,YM+ 2,11
6610 PRINT "  ALL LINES O.K.? ";
6620 GOSUB 310:PRINT
6630 IF Y$= "Y"THEN 7000
6640 RB$= "N"
6700 PLOT 3,0,YM+ 2,11
6710 PRINT "   WHICH LINE NEEDS TO BE ALTERED (1 -";YM;") ? ";
6720 LU= 0:PU= 0:NU= 1:LA= 2:GOSUB 120
6730 CL= VAL (A$)
6740 IF CL< 1OR CL> YMTHEN 6700
6750 LU= 0:NU= 0:PU= 0:LA= XM
6760 IF LU$= "Y"THEN LU= 1
6770 IF NU$= "Y"THEN NU= 1
6780 IF PU$= "Y"THEN PU= 1
6790 IF LU+ NU+ PU< 1THEN LU= 1
6800 PLOT 6,1
6810 PLOT 3,19,1+ CL:PRINT SPC( XM)
6820 PLOT 3,19,1+ CL:GOSUB 120
6830 IF L1< > XMTHEN PLOT 3,19,1+ CL:PRINT SPC( XM):GOTO 6820
6840 Z$(CL)= A$
6850 GOTO 6600
7000 F1= 1:IF RB$= "N"THEN 9000
7010 GOTO 9500
7020 PLOT 30,16,29,22,3,0,YM+ 2,11
7030 PRINT "            WORKING";
7040 FOR I= 1TO YM
7050 PRINT ".";
7060 FOR J= 1TO XM
7070 A$(J,I)= MID$ (Z$(I),J,1)
7080 B$(J,I)= ""+ A$(J,I)
7090 C$(J,I)= B$(J,I)
7100 NEXT :NEXT :PRINT
7110 GOSUB 910
7200 WL= 0
7210 LU= 0:NU= 0:PU= 0:LA= LD
7220 IF LU$= "Y"THEN LU= 1
7230 IF NU$= "Y"THEN NU= 1
7240 IF PU$= "Y"THEN PU= 1
7250 IF LU+ NU+ PU< 1THEN LU= 1
7300 IF RW$= "N"THEN 7510
7400 PLOT 6,1,3,0,YM+ 2,11
7410 PRINT "   DO YOU WANT TO USE THE WORD LIST ? ";
7420 GOSUB 310:PRINT
7430 IF Y$= "Y"THEN 7710
7500 REM  GET WORDS AND FIND IN BLOCK
7510 PLOT 6,4,3,1,YM+ 2,11
7520 PRINT "ENTER A WORD, OR Q TO QUIT ";
7530 GOSUB 120
7540 IF A$= "Q"THEN 8000
7550 IF L1< 2OR L1> LDTHEN 7510
7560 IF WC= 99THEN 7590
7570 WC= WC+ 1:RW$= "N"
7580 WL$(WC)= A$
7590 GOSUB 610
7600 IF FA= 1THEN 7510
7610 PLOT 3,0,YM+ 2,11
7620 PRINT " CANNOT FIND WORD ";WL$(WC);""
7630 FOR I= 1TO 2000:NEXT
7640 GOTO 7510
7700 REM  USE WORD LIST.
7710 WL= 1:W2= 1
7720 FOR W1= W2TO WC
7730 PLOT 6,2,3,0,YM+ 2,11
7740 PRINT " WORD NUMBER";W1;" IS ";WL$(W1)
7750 FOR I= 1TO 2000:NEXT
7760 W2= W1:A$= WL$(W1):L1= LEN (A$):GOSUB 610
7770 IF FA= 1THEN 7810
7780 PLOT 3,0,YM+ 2,11
7790 PRINT " CANNOT FIND WORD";WL$(W1);""
7800 FOR I= 1TO 2000:NEXT
7810 IF W1= WCTHEN 7950
7900 PLOT 6,2,3,0,YM+ 2,11
7910 PRINT "DO NEXT WORD? (Y/N) ";
7920 GOSUB 310
7930 IF Y$= "Y"THEN 7950
7940 W1= WC
7950 NEXT W1
7960 WL= 0
7970 GOTO 7510
8000 REM  QUIT
8010 PLOT 6,7,3,0,YM+ 2,11
8020 PRINT "   QUIT. REALLY? (Y/N) ";
8030 GOSUB 310
8040 IF Y$= "N"AND WL= 1THEN 7720
8050 IF Y$= "N"AND WL= 0THEN 7510
8060 IF WC< 1THEN 8820
8100 PLOT 3,0,YM+ 2,11
8110 PRINT " DUMP WORD LIST TO PRINTER? (Y/N) ";
8120 GOSUB 310:PRINT
8130 IF Y$= "N"THEN 8500
8140 IF BD> 0AND BD< 8THEN 8300
8150 LU= 0:NU= 1:PU= 0:LA= 1
8200 PLOT 6,4,3,0,YM+ 2,11
8210 PRINT " ENTER BAUD RATE  (1-7) ";
8220 GOSUB 120
8230 BD= VAL (A$)
8240 IF BD< 1OR BD> 7THEN 8200
8300 PLOT 14,27,18,BD,15
8310 BO= PEEK (33265)
8320 PLOT 27,13
8330 PRINT CHR$ (12)
8340 PRINT ":PRINT
8350 PRINT "     W O R D   F I N D E R"
8360 PRINT :PRINT
8370 FOR I= 1TO WC
8380 IF I< 10THEN PRINT " ";
8390 PRINT I;"   ";WL$(I)
8400 NEXT
8410 POKE 33265,BO
8500 PLOT 3,0,YM+ 2,11
8510 IF RW$= "Y"THEN 8820
8520 PRINT "SAVE THE SEARCHED WORDS TO DISK? (Y/N) ";
8530 GOSUB 310:PRINT
8540 IF Y$= "N"THEN 8820
8600 PLOT 3,0,YM+ 2,11
8610 LU= 1:NU= 0:PU= 0:LA= 6
8620 PRINT "ENTER FILE NAME (DEFAULT=WORD) ";
8630 GOSUB 120
8640 IF A$= ""THEN A$= "WORD"
8700 FO$= A$+ ".RND"
8710 PLOT 3,35,YM+ 2:PRINT "WRITING ";FO$;
8720 FILE "N",FO$,WC+ 1,28,9
8730 FILE "R",1,FO$,3
8740 PRINT ".";
8750 PUT 1;WC
8760 FOR I= 1TO WC
8770 PRINT ".";
8780 PUT 1;WL$(I)[28]
8790 NEXT
8800 FILE "C",1
8810 PRINT
8820 F1= 2:IF RB$= "N"THEN 9000
8830 GOTO 9500
8900 GOSUB 11120:Z= TM+ 7:AD= E1:GOSUB 11110
8910 PLOT 3,0,29,27,11
8920 END
9000 REM  SAVE WORD BLOCK TO DISK.
9010 PLOT 3,0,YM+ 2,11
9020 PRINT "SAVE WORD BLOCK ON DISK? (Y/N) ";
9030 GOSUB 310:PRINT
9040 IF Y$= "N"THEN 9500
9100 PLOT 6,7,3,0,YM+ 2,11
9110 PRINT "ENTER FILE NAME (DEFAULT=BLOCK) ";
9120 LU= 1:NU= 0:PU= 0:LA= 6:GOSUB 120
9130 IF A$= ""THEN A$= "BLOCK"
9140 FO$= A$+ ".RND"
9200 PLOT 3,34,YM+ 2
9210 PRINT "WRITING ";FO$;
9220 FILE "N",FO$,29,28,7
9230 FILE "R",1,FO$,7
9240 PRINT ".";
9250 PUT 1;XM,YM,LU$[1],NU$[1],PU$[1]
9260 FOR I= 1TO YM
9270 PRINT ".";
9280 PUT 1;Z$(I)[XM]
9290 NEXT
9300 FILE "C",1
9310 PRINT
9320 RB$= "Y"
9500 PLOT 6,4,3,0,YM+ 2,11
9510 PRINT " DUMP BLOCK TO PRINTER? (Y/N) ";
9520 GOSUB 310:PRINT
9530 IF Y$= "N"THEN 9820
9540 IF BD> 0AND BD< 8THEN 9650
9550 LU= 0:NU= 1:PU= 0:LA= 1
9600 PLOT 6,4,3,0,YM+ 2,11
9610 PRINT "ENTER BAUD RATE  (1-7) ";
9620 GOSUB 120
9630 BD= VAL (A$)
9640 IF BD> 7OR BD< 1THEN 9600
9650 PLOT 14,27,18,BD,15
9660 BO= PEEK (33265)
9670 PLOT 27,13
9680 PRINT CHR$ (12)
9690 PRINT :PRINT
9700 PRINT "     W O R D   F I N D E R"
9710 PRINT :PRINT
9720 FOR I= 1TO YM
9730 PRINT "   ";
9740 FOR J= 1TO XM
9750 PRINT MID$ (Z$(I),J,1);" ";
9760 NEXT
9770 PRINT
9780 NEXT
9790 PRINT :PRINT
9800 PRINT "     Find the Hidden Words!"
9810 POKE 33265,BO
9820 IF F1= 2THEN 8900
9830 GOTO 7020
10000 REM  FILE ERROR TRAPPING
10010 PRINT ""
10020 FILE "E",FL,ER,LN
10030 PLOT 6,65,3,0,30,11
10040 PRINT M$(ER/ 2)
10050 FOR I= 1TO 5000:NEXT
10060 PLOT 6,1,3,0,30,11
10070 IF LN< 4200THEN 3510
10080 IF LN< 8000THEN 4400
10090 IF LN< 8800THEN 8520
10100 GOTO 9010
11000 DATA  245,175,50,255,129,241,201
11010 GOSUB 11120:RESTORE 11000
11020 IF  TM> 65528 THEN TM= TM- 7:GOTO 11060
11030 FOR  J= 1 TO  7 :READ  D
11040 IF  D< > PEEK (TM+ J) THEN J= 7:TM= TM- 7
11050 NEXT
11060 RESTORE 11000
11070 FOR  J= 1 TO  7:READ  D:POKE  TM+ J,D:NEXT
11080 Z= TM+ 1:AD= 33222:GOSUB 11110:POKE  33221,195
11090 Z= TM:AD= E1:GOSUB 11110
11100 CLEAR 4000:POKE 33247,31:GOTO 2100
11110 ZZ= INT (Z/ 256):POKE  AD,Z- 256* ZZ:POKE  AD+ 1,ZZ:RETURN
11120 E1= 32940:TM= 256* PEEK (E1+ 1)+ PEEK (E1):RETURN
11130 REM  * FOR NO-ECHO, POKE 33247,31
11140 REM  * TO RETURN TO ECHO,POKE 33247,12 (AN
11150 REM  * INPUT STATEMENT OR THE END OF THE
11160 REM  * PROGRAM WILL ALSO RETURN TO ECHO
12000 REM
12010 REM  VARIABLES LISTING
12020 REM
12100 REM
12110 REM    GENERAL INPUT SUBROUTINE
12120 REM
12130 REM     A     TEMPORARY ASCII CODE FOR KEYBOARD INPUT.
12140 REM     A$    INPUT CHARACTER STRING.
12150 REM    KB     KEYBOARD LOCATION (33278) TO PEEK & POKE.
12160 REM    L1     LENGTH OF CURRENT INPUT STRING.
12170 REM    LA     LENGTH ALLOWED FOR INPUT STRING.
12180 REM    LU     LETTERS USED FLAG.
12190 REM    NU     NUMBERS USED FLAG.
12200 REM    PU     PUNCTUATION USED FLAG.
12210 REM    --> CALLER PASSES LA, LU, NU, & PU TO SUBROUTINE.
12220 REM        SUBROUTINE RETURNS A$ & L1.
12300 REM
12310 REM    Y OR N INPUT SUBROUTINE
12320 REM
12330 REM     A     TEMPORARY ASCII CODE FROM KEYBOARD INPUT.
12340 REM    KB     KEYBOARD LOCATION (33278) TO PEEK & POKE.
12350 REM     Y$    Y OR N ANSWER.
12360 REM    --> CALLER PASSES NOTHING TO SUBROUTINE.
12370 REM        SUBROUTINE RETURNS Y$.
12400 REM
12410 REM    FIND FIRST TWO LETTERS IN BLOCK SUBROUTINE.
12420 REM
12430 REM     A$    WORD TO LOOK FOR IN BLOCK.
12440 REM    FA     FOUND ALL LETTERS FLAG.
12450 REM     I     INDEX INTO BLOCK. LIMITED BY YM.
12460 REM    I1     DIRECTION INDEX LIMITED BY MI & PI.
12470 REM    I2     TEMPORARY STORAGE OF I1.
12480 REM     J     INDEX INTO BLOCK. LIMITED BY XM.
12490 REM    J1     DIRECTION INDEX LIMITED BY MJ & PJ.
12500 REM    J2     TEMPORARY STORAGE OF J1.
12510 REM    L1     LENGTH OF A$
12520 REM    MI     SEARCH DIRECTION FLAG. MINUS I ALLOWED.
12530 REM    MJ     SEARCH DIRECTION FLAG. MINUS J ALLOWED.
12540 REM    PI     SEARCH DIRECTION FLAG. PLUS  I ALLOWED.
12550 REM    PJ     SEARCH DIRECTION FLAG. PLUS  J ALLOWED.
12560 REM    SI     START LOCATION IN BLOCK FOR DISCOVERED WORD.
12570 REM    SJ     START LOCATION IN BLOCK FOR DISCOVERED WORD.
12580 REM    SM$( ) INDIVIDUAL CHARACTERS FROM A$.
12590 REM    X1$    FIRST LETTER OF A$ [ SM$(1) ].
12600 REM    X2$    SECOND LETTER OF A$ [ SM$(2) ].
12610 REM    XM     X MAXIMUM. HORIZONTAL LENGTH OF BLOCK.
12620 REM    YM     Y MAXIMUM.  VERTICAL  LENGTH OF BLOCK.
12630 REM    --> CALLER PASSES A$ & L1 TO SUBROUTINE.
12640 REM        SUBROUTINE PASSES I,I1,J,J1,L1,SM$( )
12650 REM         TO FIND REST OF WORD SUBROUTINE.
12660 REM        SUBROUTINE PASSES FA,I1,I2,J1,J2,L1,SI,SJ TO
12670 REM         PRINT BLOCK SUBROUTINE (RESTORE COLORS IN B$)
12680 REM        SUBROUTINE RETURNS FA.
12700 REM
12710 REM    FIND REST OF WORD SUBROUTINE.
12720 REM
12730 REM     A$( ) WORD BLOCK WITH NO COLORS CONCATENATED.
12740 REM     B$( ) WORD BLOCK, MOST RECENT WORD IN YELLOW.
12750 REM     C$( ) WORD BLOCK, ALL WORDS DISCOVERED IN YELLOW.
12760 REM    CY$    COLOR YELLOW. ADD TO LETTER TO GET YELLOW.
12770 REM    FA     FOUND ALL LETTERS FLAG.
12780 REM     I     INDEX INTO WORD BLOCK.
12790 REM    I1     SEARCH DIRECTION FOR I INDEX.
12800 REM    I3     CALCULATED POSITION BASED ON I,I1,X.
12810 REM     J     INDEX INTO WORD BLOCK.
12820 REM    J1     SEARCH DIRECTION FOR J INDEX.
12830 REM    J3     CALCULATED POSITION BASED ON J,J1,X.
12840 REM    L1     LENGTH OF WORD. # OF ITEMS IN SM$( ).
12850 REM    SM$( ) INDIVIDUAL CHARACTERS FROM A$.
12860 REM     X     TEMPORARY INDEX INTO SM$( ).
12870 REM    -->  CALLER PASSES I,I1,J,J1,L1,SM$( ).
12880 REM         SUBROUTINE RETURNS FA AND ADDS YELLOW COLOR
12890 REM          TO WORD BLOCKS B$( ) & C$( ).
12900 REM
12910 REM    PRINT BLOCK SUBROUTINE
12920 REM
12930 REM     A$( ) WORD BLOCK WITH NO COLORS CONCATENATED.
12940 REM     B$( ) WORD BLOCK, MOST RECENT WORD IN YELLOW.
12950 REM     C$( ) WORD BLOCK, ALL WORDS DISCOVERED IN YELLOW.
12960 REM    CC$    COLOR CYAN. TO RE-COLOR B$( ).
12970 REM    FA     FOUND ALL LETTERS FLAG.
12980 REM     I     INDEX INTO WORD BLOCK.
12990 REM    I1     SEARCH DIRECTION FOR I INDEX.
13000 REM    I3     CALCULATED POSITION BASED ON SI,I1,X.
13010 REM     J     INDEX INTO WORD BLOCK.
13020 REM    J1     SEARCH DIRECTION FOR J INDEX.
13030 REM    J3     CALCULATED POSITION BASED ON SJ,J1,X.
13040 REM    L1     LENGTH OF WORD. # OF ITEMS IN SM$( ).
13050 REM    SI     START LOCATION IN BLOCK FOR DISCOVERED WORD.
13060 REM    SJ     START LOCATION IN BLOCK FOR DISCOVERED WORD.
13070 REM     X     TEMPORARY INDEX.
13080 REM    XM     X MAXIMUM. HORIZONTAL LENGTH OF BLOCK.
13090 REM    YM     Y MAXIMUM.  VERTICAL  LENGTH OF BLOCK.
13100 REM    --> CALLER PASSES FA,I1,J1,L1,SI,SJ.
13110 REM        SUBROUTINE RETURNS NOTHING, BUT PRINTS BLOCKS
13120 REM         SCREEN AND RESETS BLOCK B$( ) TO ALL CYAN.
13200 REM
13210 REM    NO ECHO PATCH
13220 REM
13230 REM    AD     ADDRESS
13240 REM     D     TEMPORARY DATA
13250 REM    TM     TOP OF MEMORY
13260 REM     Z     TEMPORARY ADDRESS
13270 REM    ZZ     TEMPORARY ADDRESS
13300 REM
13310 REM   GENERAL VARIABLES
13320 REM
13330 REM    BD     BAUD RATE FOR PRINTER OUTPUT.
13340 REM    BO     BASIC OUTPUT FLAG
13350 REM    CL     CLEAR LINE. FOR EDITING A WORD BLOCK.
13360 REM    ER     ERROR CODE FROM A FILE ERROR.
13370 REM    FB$    BLOCK FILE INPUT NAME.
13380 REM    FI     FLAG 1. DETERMINES CALLER OF FILER ROUTINE.
13390 REM    FI$    INPUT FILE NAME.
13400 REM    FL     FILE NUMBER. FROM A FILE ERROR. NOT USED.
13410 REM    FO$    OUTPUT FILE NAME.
13420 REM    FW$    WORD FILE INPUT NAME.
13430 REM    LD     LONGEST DIMENSION.
13440 REM    LN     LINE NUMBER FROM A FILE ERROR.
13450 REM    LU     LETTERS USED FLAG.
13460 REM    LU$    LETTERS USED FLAG.
13470 REM     M$( ) MESSAGE. FILE ERROR MESSAGES.
13480 REM    NU     NUMBERS USED FLAG.
13490 REM    NU$    NUMBERS USED FLAG.
13500 REM    PU     PUNCTUATION USED FLAG.
13510 REM    PU$    PUNCTUATION USED FLAG.
13520 REM    RB$    READ BLOCK FILE FLAG.
13530 REM    RW$    READ WORD FILE FLAG.
13540 REM    VB$    BLOCK FILE VERSION #.
13550 REM    VW$    WORD  FILE VERSION #.
13560 REM    W1     POINTER INTO WORD LIST.
13570 REM    W2     WORD # IN WORD LIST TO START LOOKING FOR.
13580 REM    WC     WORD COUNT. # OF WORDS IN WL$( ).
13590 REM    WL     WORD LIST USED FLAG.
13600 REM    WL$( ) WORD LIST.
13610 REM    XM     X MAXIMUM. HORIZONTAL LENGTH OF WORD BLOCK.
13620 REM    YM     Y MAXIMUM.  VERTICAL  LENGTH OF WORD BLOCK.
13630 REM     Z$( ) INPUT ARRAY FOR WORD BLOCK.
13640 REM