home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
GAMES-14.ZIP
/
WORDPLAY.BAS
< prev
next >
Wrap
BASIC Source File
|
1982-12-09
|
3KB
|
45 lines
100 '*** Sentence: Created 9-17-82 by Robert Parnell ***
110 '
120 RANDOMIZE VAL(RIGHT$(TIME$,2))*VAL(MID$(TIME$,4,2)): DEFINT A-Z
130 DEF FNUPS$(X$)=CHR$(ASC(X$)+32*(ASC(X$)>96 AND ASC(X$)<123)): DEF SEG
140 DIM WORD$[3,200]: PART$[1]="adjective": PART$[2]="noun": PART$[3]="verb"
150 FOR X=1 TO 3: ON ERROR GOTO 170: OPEN "I",#1,LEFT$(PART$[X],8)+".DAT"
160 IF EOF(1) THEN 190 ELSE N[X]=N[X]+1: LINE INPUT #1,WORD$[X,N[X]]: GOTO 160
170 RESUME 180
180 OPEN "O",#1,LEFT$(PART$[X],8)+".DAT"
190 CLOSE: COLOR 10: CLS: COLOR 13: POKE 91,4: ON ERROR GOTO 0
200 COLOR 14: PRINT "Enter "PART$[X]"s (There are"N[X]"on file)."
210 PRINT "Type a null RETURN to end."CHR$(13): L[X]=N[X]: LOCATE ,,1
220 COLOR 13: PRINT USING "###";L[X]+1;: PRINT ">";: COLOR 10: A$=""
230 Q$=FNUPS$(INPUT$(1)): L=LEN(A$): IF Q$<>CHR$(27) THEN 250
240 LOCATE ,5: PRINT SPC(L);: LOCATE ,5: A$="": GOTO 230
250 IF Q$<>CHR$(8) THEN 270 ELSE LOCATE ,L+4-(L=0): PRINT " ";
260 LOCATE ,L+4-(L=0): IF L<>0 THEN A$=LEFT$(A$,L-1): GOTO 230 ELSE 230
270 IF Q$=CHR$(13) THEN 290 ELSE IF ASC(Q$)<32 OR L=75 THEN 230
280 PRINT Q$;: A$=A$+Q$: GOTO 230
290 PRINT: IF L=0 THEN 320 ELSE FOR Z=1 TO L[X]
300 IF WORD$[X,Z]=A$ THEN COLOR 14: PRINT "Duplicate entry": GOTO 220
310 NEXT: L[X]=L[X]+1: WORD$[X,L[X]]=A$: GOTO 220
320 IF L[X]=0 THEN BEEP: GOTO 220 ELSE COLOR 13
330 LOCATE ,,0: POKE 91,1: NEXT X
340 PRINT CHR$(13)"Output to (P)rinter or (S)creen? ";
350 Q$=FNUPS$(INPUT$(1)): P=INSTR("SP",Q$)-1: IF P=-1 THEN 350
360 COLOR 10: IF P=0 THEN 470 ELSE COLOR 10: PRINT "P"CHR$(13)
370 FOR X=1 TO 6: COLOR X: LOCATE ,19: PRINT "Align printer and press";
380 PRINT " any key when ready.";: Q$=INKEY$: IF Q$="" THEN NEXT X: GOTO 370
390 COLOR 13: LOCATE ,1: PRINT "Press ESC to exit."SPC(25);CHR$(13): COLOR 10
400 L$="THE "+WORD$[1,RND*L[1]+.5]+" "+WORD$[2,RND*L[2]+.5]+" "
410 L$=L$+WORD$[3,RND*L[3]+.5]+" THE "+WORD$[1,RND*L[1]+.5]+" "
420 L$=L$+WORD$[2,RND*L[2]+.5]+"."+CHR$(13)
430 IF P THEN LPRINT L$ ELSE PRINT L$
440 IF CSRLIN<22 OR P=1 THEN 480
450 COLOR 16,13: PRINT "Press any key to continue.";: COLOR ,0
460 Q$=INPUT$(1): IF Q$=CHR$(27) THEN 490
470 CLS: COLOR 13: PRINT "Press ESC to exit."CHR$(13): COLOR 14
480 IF INKEY$<>CHR$(27) THEN 400
490 COLOR 10: CLS: LOCATE 12: COLOR 13: FOR X=1 TO 3: IF L[X]-N[X]=0 THEN 520
500 OPEN LEFT$(PART$[X],8)+".DAT" FOR APPEND AS #1
510 FOR Y=N[X]+1 TO L[X]: PRINT #1,WORD$[X,Y]: NEXT
520 PRINT L[X]-N[X]"new "PART$[X];: IF L[X]-N[X]<>1 THEN PRINT "s";
530 PRINT " added to the list.": CLOSE: NEXT: COLOR 10: PRINT