home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug044.arc
/
W-SEARCH.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
4KB
|
183 lines
100 WIDTH 120 : PRINT CHR$(26) : PRINT
101 CLEAR 1000
102 PRINT TAB(15); "*** WORD-SEARCH PUZZLE ***" : PRINT : PRINT
103 B$=""
104 INPUT"WHAT ARE THE X AND Y DIMENSIONS ";Y,X
105 IFX>30 OR Y>30 THEN 104
106 IF X>Y THEN U0=X:GOTO 109
107 U0=Y
108 INPUT"NUMBER OF WORDS ";N
109 DIM A$(X,Y),N$(N),L(N,3)
110 GOSUB 271
111 Q8=1
112 GOSUB 269
113 PRINT
114 FORI1=1TON
115 GOTO 119
116 REM
117 L(I1,1)=A:L(I1,2)=B:L(I1,3)=D
118 GOTO239
119 C0=0
120 S$=N$(I1)
121 Z=LEN(S$)
122 GOSUB 235
123 C0=C0+1
124 IF (C0/100)<>INT(C0/100) THEN 126
125 PRINT"TRY #";C0;" ";
126 IF C0<1000 THEN 130
127 Q8=Q8+1:IF Q8=100 THEN STOP
128 GOTO 112
129 PRINTQ8:GOTO 112
130 ON D GOTO 131,144,157,170,183,196,209,222
131 IF B+Z>Y THEN 122
132 FOR I=1 TO LEN(S$)
133 A1=A: B1=B+I-1
134 GOSUB 266
135 GOSUB 268
136 IF L$=B$ OR L$=N1$ THEN 138
137 GOTO122
138 NEXT I
139 FOR I=1TOLEN(S$)
140 GOSUB 266
141 A$(A,B+I-1)=N1$
142 NEXT I
143 GOTO116
144 IFB+Z>Y ORA-Z<1 THEN 122
145 FORI=1TOLEN(S$)
146 A1=A-(I-1):B1=B+I-1
147 GOSUB266
148 GOSUB268
149 IFL$=B$ORL$=N1$THEN 151
150 GOTO122
151 NEXT I
152 FORI=1TO LEN(S$)
153 GOSUB 266
154 A$(A-(I-1),B+I-1)=N1$
155 NEXT I
156 GOTO116
157 IF A-Z<1THEN 122
158 FORI=1TOLEN(S$)
159 A1=A-(I-1):B1=B
160 GOSUB266
161 GOSUB268
162 IF L$=B$ OR L$=N1$THEN 164
163 GOTO 122
164 NEXT I
165 FOR I=1TO LEN(S$)
166 GOSUB 266
167 A$(A-(I-1),B)=N1$
168 NEXT I
169 GOTO116
170 IF A-Z<1 ORB-Z<1THEN122
171 FORI=1TOLEN(S$)
172 A1=A-(I-1):B1=B-(I-1)
173 GOSUB 266
174 GOSUB 268
175 IFL$=B$ OR L$=N1$ THEN 177
176 GOTO122
177 NEXT I
178 FOR I=1 TO LEN(S$)
179 GOSUB 266
180 A$(A-(I-1),B-(I-1))=N1$
181 NEXT I
182 GOTO116
183 IFB-Z<1THEN 122
184 FORI=1TO LEN(S$)
185 A1=A:B1=B-(I-1)
186 GOSUB 266
187 GOSUB 268
188 IFL$=B$ORL$=N1$THEN 190
189 GOTO122
190 NEXT I
191 FOR I=1TOLEN(S$)
192 GOSUB 266
193 A$(A,B-(I-1))=N1$
194 NEXT I
195 GOTO116
196 IF (A+Z)>X OR (B-Z)<1 THEN 122
197 FORI=1TOLEN(S$)
198 A1=A+I-1:B1=B-(I-1)
199 GOSUB266
200 GOSUB268
201 IFL$=N1$ORL$=B$THEN 203
202 GOTO122
203 NEXT I
204 FOR I=1TOLEN(S$)
205 GOSUB 266
206 A$(A+I-1,B-(I-1))=N1$
207 NEXT I
208 GOTO116
209 IFA+Z>XTHEN 122
210 FORI=1TOLEN(S$)
211 A1=A+I-1:B1=B
212 GOSUB 266
213 GOSUB 268
214 IFL$=N1$ORL$=B$THEN 216
215 GOTO122
216 NEXT I
217 FORI=1TOLEN(S$)
218 GOSUB 266
219 A$(A+I-1,B)=N1$
220 NEXT I
221 GOTO116
222 IFA+Z>X ORB+Z>Y THEN 122
223 FORI=1TOLEN(S$)
224 A1=A+I-1:B1=B+I-1
225 GOSUB 266
226 GOSUB 268
227 IFL$=B$ OR L$=N1$ THEN 229
228 GOTO122
229 NEXT I
230 FORI=1TOLEN(S$)
231 GOSUB 266
232 A$(A+I-1,B+I-1)=N1$
233 NEXT I
234 GOTO116
235 A=INT(X*RND(8)+1)
236 B=INT(Y*RND(8)+1)
237 D=INT(8*RND(5)+1)
238 RETURN
239 NEXT I1
240 FORI=1TO5:PRINT:NEXT I
241 FORI=1TOX
242 FORJ=1TOY
243 IFA$(I,J)=""THEN252
244 PRINTA$(I,J);" ";
245 NEXT J
246 PRINT
247 NEXT I
248 PRINT
249 GOSUB 255
250 PRINT
251 GOTO 277
252 A$(I,J)=CHR$(INT(26*RND(1)+65))
253 GOTO 244
254 PRINT
255 INPUT"DO YOU WANT THE ANSWERS ";ANS$
256 AN=0
257 IF LEFT$(ANS$,2)="YE" THEN AN=1
258 PRINT"THE HIDDEN WORDS ARE: "
259 FOR K=1TO N
260 PRINTN$(K);
261 IF AN=0 THEN PRINT:GOTO263
262 PRINTTAB(30);L(K,1);",";L(K,2);",";L(K,3)
263 NEXT K
264 RETURN
265 GOTO 277
266 N1$=MID$(S$,I,1)
267 RETURN
268 L$=A$(A1,B1):RETURN
269 FORI=1TOX:FORJ=1TOY:A$(I,J)="":NEXTJ,I
270 RETURN
271 FORI=1TON
272 PRINT"WORD #";I;
273 INPUT N$(I)
274 IF LEN(N$(I))>U0 THEN 272
275 NEXT I
276 RETURN
277 RESET
ETURN
271 FORI=1TON
272 PRINT"WORD #";I;
273 INPUT N$(I)