****************************************************** NAME:ELIZA TYPE:BASIC FORMAT:ASCII SA/LA:0000 0000 ****************************************************** 10 CLS:PRINT @14,"ELIZA" 20 PRINT:PRINT"YOU ARE NOT FEELING WELL AND HAVE DECIDED TO CONSULT WITH A PSYCHOLOGIST ABOUT SOME OF YOUR PROBLEMS." 22 PRINT:PRINT"ELIZA WILL ASK YOU QUESTIONS DURING YOUR VISIT WHICH YOU SHOULD ANSWER WITH SHORT, BUT COMPLETE SENTENCES" 24 PRINT"ELIZA CHARGES $75 AN HOUR, SO DON'T WASTE YOUR TIME." 26 PRINT 30 INPUT"PRESS TO START SESSION";A$:CLS 40 CLEAR 1000 60 DIM S(36),R(36),N(36) 70 N1=36:N2=14:N3=112 80 FOR X=1 TO N1+N2+N3:READ Z$:NEXT X 90 FOR X=1 TO N1 100 READ S(X),L:R(X)=S(X):N(X)=S(X)+L-1 110 NEXT X 120 X$="HI!, I'M ELIZA, WHAT'S YOUR PROBLEM? 125 GOSUB 2140 130 REM 150 A$="" 160 X=PEEK(137)+PEEK(136)*256 170 POKE X,45:FOR CN=1 TO 10:B$=INKEY$:IF B$<>"" THEN 200 180 NEXT CN:POKE X,32: FOR CN=1 TO 10:B$=INKEY$ 190 IF B$<>""THEN 200 :ELSE NEXT CN: GOTO 170 200 POKE X,32:IF ASC(B$)=13 THEN 250 210 IF ASC(B$)=8 AND LEN(A$)<>0THEN 215 :ELSE 220 215 PRINT CHR$(143)CHR$(8);:A$=LEFT$(A$,LEN(A$)-1):PRINT B$; 220 IF ASC(B$)=24 THEN A$="":PRINT CHR$(29) CHR$(30); 230 IF ASC(B$)>31 AND ASC(B$)<91 THEN PRINT B$;:A$=A$+B$ 240 GOTO 160 250 PRINT: I$=A$:I$=" "+I$+" " 260 REM 270 FOR L=1 TO LEN(I$) 280 IFMID$(I$,L,1)="'"THENI$=LEFT$(I$,L-1)+RIGHT$(I$,LEN(I$)-L):GOTO 280 290 IFL+4<=LEN(I$)THEN IFMID$(I$,L,4)="SHUT"THEN END 300 NEXT L 310 IF I$=P$ THEN X$="PLEASE DON'T REPEAT YOURSELF!":GOSUB 2140:GOTO 130 350 RESTORE 360 S=0 370 FOR K=1 TO N1 380 READ K$ 390 IF S>0 THEN 430 400 FOR L=1 TO LEN(I$)-LEN(K$)+1 410 IF MID$(I$,L,LEN(K$))=K$ THEN S=K:T=L:F$=K$ 420 NEXT L 430 NEXT K 440 IF S>0 THEN K=S:L=T:GOTO 470 450 K=36:GOTO 680 470 REM CONJUGATE 500 RESTORE:FOR X=1 TO N1:READ Z$:NEXT X 510 C$=" "+RIGHT$(I$,LEN(I$)-LEN(F$)-L+1) 520 FOR X=1 TO N2/2 530 READ S$,R$ 540 FOR L=1 TO LEN(C$) 550 IF L+LEN(S$)>LEN(C$) THEN 600 560 IF MID$(C$,L,LEN(S$))<>S$ THEN 600 570 C$=LEFT$(C$,L-1)+R$+RIGHT$(C$,LEN(C$)-L-LEN(S$)+1) 580 L=L+LEN(R$) 590 GOTO 640 600 IF L+LEN(R$)>LEN(C$)THEN 640 610 IF MID$(C$,L,LEN(R$))<>R$ THEN 640 620 C$=LEFT$(C$,L-1)+S$+RIGHT$(C$,LEN(C$)-L-LEN(R$)+1) 630 L=L+LEN(S$) 640 NEXT L 650 NEXT X 660 IF MID$(C$,2,1)=" "THEN C$=RIGHT$(C$,LEN(C$)-1) 680 REM 700 RESTORE:FOR X=1 TO N1+N2:READ Z$:NEXT X 710 FOR X=1 TO R(K):READ F$:NEXT X 720 R(K)=R(K)+1:IF R(K)>N(K) THEN R(K)=S(K) 730 IF RIGHT$(F$,1)<>"*" THEN X$=F$:P$=I$:GOSUB 2140:GOTO 130 740 X$=LEFT$(F$,LEN(F$)-1)+C$:GOSUB 2140 750 P$=I$:GOTO 130 810 DATA "CAN YOU","CAN I","YOU ARE","YOURE","I DONT","I FEEL" 820 DATA"WHY DONT YOU","WHY CANT I","ARE YOU","I CANT","I AM","IM " 830 DATA"YOU ","I WANT","WHAT","HOW","WHO","WHERE","WHEN","WHY" 840 DATA"NAME","CAUSE","SORRY","DREAM","HELLO","HI ","MAYBE" 850 DATA" NO","YOUR","ALWAYS",THINK","ALIKE","YES","FRIEND" 860 DATA"COMPUTER","NOKEYFOUND" 900 DATA" ARE "," AM ","WERE ","WAS "," YOU "," I ","YOUR ","MY " 910 DATA" IVE "," YOUVE "," IM "," YOURE "," ME "," YOU " 950 DATA"DON'T YOU BELIEVE THAT I CAN*" 960 DATA"PERHAPS YOU WOULD LIKE TO BE ABLE TO*" 970 DATA"YOU WANT ME TO BE ABLE TO*" 980 DATA"PERHAPS YOU DON'T WANT TO*" 990 DATA"DO YOU WANT TO BE ABLE TO*" 1000 DATA"WHAT MAKES YOU THINK I AM*" 1010 DATA"DOES IT PLEASE YOU TO BELIEVE I AM*" 1020 DATA"PERHAPS YOU WOULD LIKE TO BE*" 1030 DATA"DO YOU SOMETIMES WISH YOU WERE*" 1040 DATA"DON'T YOU REALLY*" 1050 DATA"WHY DON'T YOU*" 1060 DATA"DO YOU WISH TO BE ABLE TO*" 1070 DATA"DOES THAT TROUBLE YOU?" 1080 DATA"TELL ME MORE ABOUT SUCH FEELINGS." 1090 DATA"DO YOU OFTEN FEEL*" 1100 DATA"DO YOU ENJOY FEELING*" 1110 DATA"DO YOU REALLY BELIEVE I DON'T*" 1120 DATA"PERHAPS IN GOOD TIME I WILL*" 1130 DATA"DO YOU WANT ME TO*" 1140 DATA"DO YOU THINK YOU SHOULD BE ABLE TO*" 1150 DATA"WHY CAN'T YOU*" 1160 DATA"WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM*" 1170 DATA"WOULD YOU PREFER IF I WERE NOT*" 1180 DATA"PERHAPS IN YOUR FANTASIES I AM*" 1190 DATA"HOW DO YOU KNOW I CAN'T*" 1200 DATA"HAVE YOU TRIED?" 1210 DATA"PERHAPS YOU CAN NOW*" 1220 DATA"DID YOU COME TO ME BECAUSE YOU ARE*" 1230 DATA"HOW LONG HAVE YOU BEEN*" 1240 DATA"DO YOU BELIEVE IT IS NORMAL TO BE*" 1250 DATA"DO YOU ENJOY BEING*" 1260 DATA"WE WERE DISCUSSING YOU--NOT ME" 1270 DATA"OH, I*" 1280 DATA"YOU'RE NOT REALLY TALKING ABOUT ME, ARE YOU?" 1290 DATA"WHAT WOULD IT MEAN TO YOU IF YOU GOT*" 1300 DATA"WHY DO YOU WANT*" 1310 DATA"SUPPOSE YOU SOON GOT*" 1320 DATA"WHAT IF YOU NEVER GOT*" 1330 DATA"I SOMETIMES ALSO WANT*" 1340 DATA"WHY DO YOU ASK?" 1350 DATA"DOES THAT QUESTION INTEREST YOU?" 1360 DATA"WHAT ANSWER WOULD PLEASE YOU THE MOST?" 1370 DATA"WHAT DO YOU THINK?" 1380 DATA"ARE SUCH QUESTIONS ON YOUR MIND OFTEN?" 1390 DATA"WHAT IS IT THAT YOU REALLY WANT TO KNOW?" 1400 DATA"HAVE YOU ASKED ANYONE ELSE?" 1410 DATA"HAVE YOU ASKED SUCH QUESTIONS BEFORE?" 1420 DATA"WHAT ELSE COMES TO MIND WHEN YOU ASK THAT?" 1430 DATA"NAMES DON'T INTEREST ME" 1440 DATA"I DON'T CARE ABOUT NAMES--PLEASE GO ON" 1450 DATA"IS THAT THE REAL REASON?" 1460 DATA"DON'T ANY OTHER REASONS COME TO MIND?" 1470 DATA"DOES THAT REASON EXPLAIN ANY- THING ELSE?" 1480 DATA"WHAT OTHER REASONS MIGHT THERE BE?" 1490 DATA"PLEASE, DON'T APOLOGIZE!" 1500 DATA"APOLOGIES ARE NOT NECESSARY" 1510 DATA"WHAT FEELINGS DO YOU HAVE WHEN YOU APOLOGIZE?" 1520 DATA"DON'T BE SO DEFENSIVE!" 1530 DATA"WHAT DOES THAT DREAM SUGGEST TO YOU?" 1540 DATA"DO YOU DREAM OFTEN?" 1550 DATA"WHAT PERSONS APPEAR IN YOUR DREAMS?" 1560 DATA"ARE YOU DISTURBED BY YOUR DREAMS?" 1570 DATA"HOW DO YOU...PLEASE STATE YOUR PROBLEM" 1580 DATA"YOU DON'T SEEM QUITE CERTAIN" 1590 DATA"WHY THE UNCERTAIN TONE?" 1600 DATA"CAN'T YOU BE MORE POSITIVE?" 1610 DATA"YOU AREN'T SURE?" 1620 DATA"DON'T YOU KNOW?" 1630 DATA"ARE YOU SAYING 'NO' JUST TO BE NEGATIVE?" 1640 DATA"YOU ARE BEING A BIT NEGATIVE" 1650 DATA"WHY NOT?" 1660 DATA"ARE YOU SURE?" 1670 DATA"WHY NO?" 1680 DATA"WHY ARE YOU CONCERNED ABOUT MY*" 1690 DATA"WHAT ABOUT YOUR OWN*" 1700 DATA"CAN YOU THINK OF A SPECIFIC EXAMPLE?" 1710 DATA"WHEN?" 1720 DATA"WHAT ARE YOU THINKING OF?" 1730 DATA"REALLY, ALWAYS?" 1740 DATA"DO YOU REALLY THINK SO?" 1750 DATA"BUT YOU ARE NOT SURE YOU*" 1760 DATA"DO YOU DOUBT YOU*" 1770 DATA"IN WHAT WAY?" 1780 DATA"WHAT RESEMBLANCE DO YOU SEE?" 1790 DATA"WHAT DOES THE SIMILARITY SUGGEST TO YOU?" 1800 DATA"WHAT OTHER CONNECTIONS DO YOU SEE?" 1810 DATA"COULD THERE REALLY BE SOME CONNECTION?" 1820 DATA"HOW?" 1830 DATA"YOU SEEM QUITE POSITIVE" 1840 DATA"ARE YOU SURE?" 1850 DATA"I SEE" 1860 DATA"I UNDERSTAND" 1870 DATA"WHY DO YOU BRING UP THE TOPIC OF FRIENDS?" 1880 DATA"DO YOUR FRIENDS WORRY YOU?" 1890 DATA"DO YOUR FRIENDS PICK ON YOU?" 1900 DATA"ARE YOU SURE YOU HAVE ANY FRIENDS?" 1910 DATA"DO YOU IMPOSE ON YOUR FRIENDS?" 1920 DATA"PERHAPS YOUR LOVE FOR FRIENDS WORRY YOU" 1930 DATA"DO COMPUTERS WORRY YOU?" 1940 DATA"ARE YOU TALKING ABOUT M IN PARTICULAR?" 1950 DATA"ARE YOU FRIGHTENED BY MACHINES?" 1960 DATA"WHY DO YOU MENTION COMPUTERS?" 1970 DATA"WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEM?" 1980 DATA"DON'T YOU THINK COMPUTERS CAN HELP PEOPLE?" 1990 DATA"WHAT IS IT ABOUT MACHINES THAT WORRIES YOU?" 2000 DATA"SAY, DO YOU HAVE ANY PSYCHOLOGI-CAL PROBLEMS?" 2010 DATA"WHAT DOES THAT SUGGEST TO YOU?" 2020 DATA"I SEE" 2030 DATA"I'M NOT SURE I UNDERSTAND YOU FULLY" 2040 DATA"COME, COME, ELUCIDATE YOUR THOUGHTS" 2050 DATA"CAN YOU ELABORATE ON THAT?" 2060 DATA"THAT IS QUITE INTERESTING" 2100 DATA1,3,4,2,6,4,6,4,10,4,14,3,17,3,20,2,22,3,25,3 2110 DATA 28,4,28,4,32,3,35,5,40,9,40,9,40,9,40,9,40,9,40,9 2120 DATA 49,2,51,4,55,4,59,4,63,1,63,1,64,5,69,5,74,2,76,4 2130 DATA 80,3,83,7,90,3,93,6,99,7,106,6 2140 IF PEEK(137)+PEEK(136)*256=>1504 THEN CLS 2150 PRINT CHR$(14);:FOR X=1 TO LEN(X$) 2152 IF POS(0)<25 THEN 2158 2154 IF MID$(X$,X,1)<>" "THEN 2158 2156 PRINT:GOTO 2159 2158 PRINT MID$(X$,X,1); 2159 NEXT X:PRINT:RETURN 2160 FOR TM=1 TO 20: NEXT TM,X:PRINT CHR$(15):RETURN 0