10 REM
20 REM
30 REM
40 REM
50 REM
60 REM
70 REM
80 REM
90 REM
100 REM
110 REM
120 REM
130 REM
140 REM
150 REM
160 REM
170 REM
180 REM
190 REM
200 REM
210 PRINT "                         ______            "
220 PRINT "                        /     /\           "
230 PRINT "                       /     /  \          "
240 PRINT "                      /     /    \        "
250 PRINT "                     /     /\     \        "
260 PRINT "                    /     /  \     \       "
270 PRINT "                 INFOTRAN TELERESOURCE   "
280 PRINT "                  /     /      \     \     "
290 PRINT "                 /     /        \     \    "
300 PRINT "                /     /_ _ _ _ _ \     \   "
310 PRINT "                \    /            \    /   "
320 PRINT "                 \  /              \  /    "
330 PRINT "                  \/_ _ _ _ _ _ _ _ \/     "
340 PRINT "                                           "
350 PRINT "              A DIVISION OF INFOTRAN CORP."
360 PRINT "                     HOUSTON, TEXAS"
370 PRINT ""
380 PRINT "           COPYRIGHT (C) INFOTRAN CORP. 1983"
390 FOR I = 1 TO 5 : PRINT : NEXT I
400 FOR I = 1 TO 2000
410 NEXT I
420 FOR I = 1 TO 24
430 PRINT
440 NEXT I
450 PRINT "               *** NOW on THE SOURCE ***"
460 PRINT ""
470 PRINT "            GREAT PROGRAMS YOU CAN DOWNLOAD "
480 PRINT "           INTO YOUR COMPUTER ... IMMEDIATELY"
490 PRINT ""
500 PRINT "        ****************************************"
510 PRINT "           ADVENTURES --- GAMES --- BUSINESS"
520 PRINT "             EDUCATION --- SCIENCE --- MATH"
530 PRINT ""
540 PRINT "         SOFTWARE AVAILABLE FOR MOST COMPUTERS"
550 PRINT "        ****************************************"
560 PRINT ""
570 PRINT "        DON'T LEAVE HOME..."
580 PRINT "                SAVE ON GREAT SOFTWARE..."
590 PRINT "                            USE TELERESOURCE ..."
600 PRINT ""
610 PRINT "        TO ACCESS TELERESOURCE:"
620 PRINT "           AT COMMAND LEVEL ON THE SOURCE,"
630 PRINT "                 -------------------------------"
640 PRINT "                 TYPE: CO SFILES>ST3899>SOFTWARE"
650 PRINT "                 -------------------------------"
660 PRINT ""
670 PRINT "        CONTINUE - PRESS RETURN";
680 INPUT Q$
690 FOR I = 1 TO 24
700 PRINT
710 NEXT I
720 '   ELIZA/DOCTOR
730 '   CREATED BY JOESEPH WEIZENBAUM
740 '   THIS VERSION BY JEFF SHRAGER
750 '   EDITED AND MODIFIED FOR IBM-PC BASICA A BY WILBUR STREETT
760 '   1806 PITNEY STREET, OCEAN, NJ, 07712, 531-3790
770 '
780 '  ----------INITIALAZATION-----------
790 DIM C$(72),I$(72),K$(72),F$(72),S$(72),R$(72),P$(72),Z$(72)
800 DIM S(36),R(36),N(36)
810 N1=36:N2=12:N3=112
820 FOR X=1 TO N1+N2+N3:READ Z$:NEXT X:REM SAME AS RESTORE
830 FOR X=1 TO N1
840 READ S(X),L:R(X)=S(X):N(X)=S(X)+L-1
850 NEXT X
860 PRINT "HI!  I'M ELIZA.  WHAT'S YOUR PROBLEM?"
870 REM
880 REM    ------- USER  INPUT  SECTION----------
890 REM
900 LINE INPUT I$
910 I$=" "+I$+"  " '   GET RID OF APOSTROPHES
920 FOR L=1 TO LEN(I$)
930 IF MID$(I$,L,1)="'" THEN I$=LEFT$(I$,L-1)+RIGHT$(I$,LEN(I$)-L):GOTO 930
940 IF L+4<=LEN(I$) THEN IF MID$(I$,L,4)="SHUT" THEN PRINT "SHUT UP....":END
950 NEXT L
960 IF I$=P$ THEN PRINT "PLEASE DON'T REPEAT YOURSELF!":GOTO 870
970 REM
980 REM    --------FIND KEYWORD IN I$-----
990 REM
1000 RESTORE
1010 S=0
1020 FOR K=1 TO N1
1030 READ K$
1040 IF S>0 THEN 1080
1050 FOR L=1 TO LEN(I$)-LEN(K$)+1
1060 IF MID$(I$,L,LEN(K$))=K$ THEN S=K:T=L:F$=K$
1070 NEXT L
1080 NEXT K:IF S>0 THEN K=S:L=T:GOTO 1110
1090 K=36:GOTO 1310:REM WE DIDN'T FIND ANY KEYWORDS
1100 REM
1110 REM     TAKE RIGHT PART OF STRING AND CONJUGATE IT
1120 REM     USING THE LIST OF STRINGS TO BE SWAPPED
1130 REM
1140 RESTORE:FOR X=1 TO N1:READ Z$:NEXT X:REM SKIP OVER KEYWORDS
1150 C$=" "+RIGHT$(I$,LEN(I$)-LEN(F$)-L+1)
1160 FOR X=1 TO N2/2
1170 READ S$,R$
1180 FOR L=1 TO LEN(C$)
1190 IF L+LEN(S$)=LEN(C$) THEN 1240
1200 IF MID$(C$,L,LEN(S$))<>S$ THEN 1240
1210 C$=LEFT$(C$,L-1)+R$+RIGHT$(C$,LEN(C$)-L-LEN(S$)+1)
1220 L=L+LEN(R$)
1230 GOTO 1270
1240 IF L+LEN(R$)>LEN(C$) THEN 1270
1250 IF MID$(C$,L,LEN(R$))<>R$ THEN 1270
1260 C$=LEFT$(C$,L-1)+S$+RIGHT$(C$,LEN(C$)-L-LEN(R$)+1)
1270 NEXT L
1280 NEXT X
1290 IF MID$(C$,2,1)=" " THEN C$=RIGHT$(C$,LEN(C$)-1):REM ONLY 1 SPACE
1300 REM
1310 REM   NOW USING THE KEYWORD NUMBER (K) GET REPLY
1320 REM
1330 RESTORE:FOR X=1 TO N1+N2:READ Z$:NEXT X
1340 FOR X=1 TO R(K):READ F$:NEXT X:REM  READ RIGHT REPLY
1350 R(K)=R(K)+1:IF R(K)>N(K) THEN R(K)=S(K)
1360 IF RIGHT$(F$,1)<>"*" THEN PRINT F$:P$=I$:GOTO 870
1370 PRINT LEFT$(F$,LEN(F$)-1);C$
1380 P$=I$:GOTO 870
1390 REM
1400 REM   ---------PROGRAM DATA FOLLOWS----------
1410 REM
1420 REM       KEYWORDS
1430 REM
1440 DATA "CAN YOU","CAN I","YOU ARE","YOURE","I DONT","I FEEL"
1450 DATA "WHY DONT YOU","WHY CANT I","ARE YOU","I CANT","I AM","IM "
1460 DATA "YOU ","I WANT","WHAT","HOW","WHO","WHERE","WHEN","WHY"
1470 DATA "NAME","CAUSE","SORRY","DREAM","HELLO","HI ","MAYBE"
1480 DATA "NO ","YOUR","ALWAYS","THINK","ALIKE","YES","FRIEND"
1490 DATA "COMPUTER","NOKEYFOUND"
1500 REM
1510 REM     STRING DATA FOR CONJUGATIONS
1520 REM
1530 DATA " ARE "," AM ","WERE ","WAS "," YOU "," I "," YOUR ","MY "
1540 DATA " IVE "," YOURVE "," IM "," YOURE "
1550 REM
1560 REM    REPLIES
1570 REM
1580 DATA "DON'T YOU BELIEVE THAT I CAN*"
1590 DATA "PERHAPS YOU WOULD LIKE TO BE ABLE TO*"
1600 DATA "YOU WANT ME TO BE ABLE TO*"
1610 DATA "PERHAPS YOU DON'T WANT TO*"
1620 DATA "DO YOU WANT TO BE ABLE TO*"
1630 DATA "WHAT MAKES YOU THINK I AM*"
1640 DATA "DOES IT PLEASE YOU TO BELIEVE I AM*"
1650 DATA "PERHAPS YOU WOULD LIKE TO BE*"
1660 DATA "DO YOU SOMETIMES WISH YOU WERE*"
1670 DATA "DON'T YOU REALLY*"
1680 DATA "WHY DON'T YOU*"
1690 DATA "DO YOU WISH TO BE ABLE TO*"
1700 DATA "DOES THAT TROUBLE YOU?"
1710 DATA "TELL ME MORE ABOUT SUCH FELLINGS."
1720 DATA "DO YOU OFTEN FEEL*"
1730 DATA "DO YOU ENJOY FEELING*"
1740 DATA "DO YOU REALLY BELIEVE I DON'T*"
1750 DATA "PERHAPS IN GOOD TIME I WILL*"
1760 DATA "DO YOU WANT ME TO*"
1770 DATA "DO YOU THINK YOU SHOULD BE ABLE TO*'
1780 DATA "WHY CAN'T YOU*"
1790 DATA "WHY ARE YOU INTERESTED IN WHETER OR NOT I AM*"
1800 DATA "WOULD YOU PREFER IF I WERE NOT*"
1810 DATA "PERHAPS IN YOUR FANTASIES I AM*"
1820 DATA "HOW DO YOU KNOW YOU CAN'T*"
1830 DATA "HAVE YOU TRIED?"
1840 DATA "PERHAPS YOU CAN NOW*"
1850 DATA "DID YOU COME TO ME BECAUSE YOU ARE*"
1860 DATA "HOW LONG HAVE YOU BEEN*"
1870 DATA "DO YOU BELIEVE IT IS NORMAL TO BE*"
1880 DATA "DO YOU ENJOY BEING*"
1890 DATA "WE WERE DISCUSSING YOU-- NOT ME."
1900 DATA "OH, I*"
1910 DATA "YOU'RE NOT REALLY TALKING ABOUT ME, ARE YOU?"
1920 DATA "WHAT WOULD IT MEAN TO YOU IF I GOT*"
1930 DATA "WHY DO YOU WANT*"
1940 DATA "SUPPOSE YOU SOON GOT*"
1950 DATA "WHAT IF YOU NEVER GOT*"
1960 DATA "I SOMETIMES ALSO WANT*"
1970 DATA "WHY DO YOU ASK?"
1980 DATA "DOES THAT QUESTION INTEREST YOU?"
1990 DATA "WHAT ANSWER WOULD PLEASE YOU THE MOST?"
2000 DATA "WHAT DO YOU THINK?"
2010 DATA "ARE SUCH QUESTIONS ON YOUR MIND OFTEN?"
2020 DATA "WHAT IS IT THAT YOU REALLY WHAT TO KNOW?"
2030 DATA "HAVE YOU ASKED ANYONE ELSE?"
2040 DATA "HAVE YOU ASKED SUCH QUESTIONS BEFORE?"
2050 DATA "WHAT ELSE COMES TO MIND WHEN YOU ASK THAT?"
2060 DATA "NAMES DON'T INTEREST ME."
2070 DATA "I DON'T CARE ABOUT NAMES--  PLEASE GO ON."
2080 DATA "IS THAT THE REAL REASON?"
2090 DATA "DON'T ANY OTHER REASONS COME TO MIND?"
2100 DATA "DOES THAT REASON EXPLAIN ANYTHING ELSE?"
2110 DATA "WHAT OTHER REASONS MIGHT THERE BE?"
2120 DATA "PLEASE DON'T APOLOGIZE!"
2130 DATA "APOLOGIES ARE NOT NECESSARY."
2140 DATA "WHAT FEELING DO YOU HAVE WHEN YOU APOLOGIZE?"
2150 DATA "DON'T BE SO DEFENSIVE!"
2160 DATA "WHAT DOES THAT DREAM SUGGEST TO YOU?"
2170 DATA "DO YOU DREAM OFTEN?"
2180 DATA "WHAT PERSONS APPEAR IN YOUR DREAMS?"
2190 DATA "ARE YOU DISTURBED BY YOUR DREAMS?"
2200 DATA "HOW DO YOU DO ....  PLEASE STATE YOUR PROBLEM."
2210 DATA "YOU DON'T SEEM QUITE CERTAIN."
2220 DATA "WHY THE UNCERTAIN TONE?"
2230 DATA "CAN'T YOU BE MORE POSITIVE?"
2240 DATA "YOU AREN'T SURE?"
2250 DATA "DON'T YOU KNOW?"
2260 DATA "ARE YOU SAYING NO JUST TO BE NEGATIVE?"
2270 DATA "YOU ARE BEING A BIT NEGATIVE."
2280 DATA "WHY NOT?"
2290 DATA "ARE YOU SURE?"
2300 DATA "WHY NO?"
2310 DATA "WHY ARE YOU CONCERNED ABOUT MY*"
2320 DATA "WHAT ABOUT YOUR OWN*"
2330 DATA "CAN YOU THINK OF A SPECIFIC EXAMPLE?"
2340 DATA "WHEN?"
2350 DATA "WHAT ARE YOU THINKING OF?"
2360 DATA "REALLY, ALWAYS?"
2370 DATA "DO YOU REALLY THINK SO?"
2380 DATA "BUT YOU ARE NOT SURE YOU*"
2390 DATA "DO YOU DOUBT YOU*"
2400 DATA "IN WHAT WAY?"
2410 DATA "WHAT RESEMBLANCE DO YOU SEE?"
2420 DATA "WHAT DOES THE SIMILARITY SUGGEST TO YOU?"
2430 DATA "WHAT OTHER CONNECTIONS DO YOU SEE?"
2440 DATA "COULD THER REALLY BE SOME CONNECTION?"
2450 DATA "HOW?"
2460 DATA "YOU SEEM QUITE POSITIVE."
2470 DATA "ARE YOU SURE?"
2480 DATA "I SEE."
2490 DATA "I UNDERSTAND."
2500 DATA "WHY DO YOU BRING UP THE TOPIC OF FRIENDS?"
2510 DATA "DO YOUR FRIENDS WORRY YOU?"
2520 DATA "DO YOUR FRIENDS PICK ON YOU?"
2530 DATA "ARE YOU SURE YOU HAVE ANY FRIENDS?"
2540 DATA "DO YOU IMPOSE ON YOUR FRIENDS?"
2550 DATA "PERHAPS YOUR LOVE FOR FRIENDS WORRIES YOU."
2560 DATA "DO COMPUTERS WORRY YOU?"
2570 DATA "ARE YOU TALKING ABOUT ME IN PARTICULAR?"
2580 DATA "ARE YOU FRIGHTENED BY MACHINES?"
2590 DATA "WHY DO YOU MENTION COMPUTERS?"
2600 DATA "WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEM?"
2610 DATA "DON'T YOU THINK COMPUTERS CAN HELP PEOPLE?"
2620 DATA "WHAT IS IT ABOUT COMPUTER THAT WORRIES YOU?"
2630 DATA "SAY, DO YOU HAVE ANY PSYCHOLOGICAL PROBLEMS?"
2640 DATA "WHAT DOES THAT SUGGEST TO YOU?"
2650 DATA "I SEE."
2660 DATA "I'M NOT SURE I UNDERSTAND YOU FULLY."
2670 DATA "COME, COME, ELUCIDATE YOUR THOUGHTS."
2680 DATA "CAN YOU ELABORATE ON THAT?"
2690 DATA "THAT IS QUITE INTERESTING."
2700 REM
2710 REM    DATA FOR FINDING RIGHT REPLIES
2720 REM
2730 DATA 1,3,4,2,6,4,6,4,10,4,14,3,17,3,20,2,22,3,25,3
2740 DATA 28,4,28,4,32,3,35,5,40,9,40,9,40,9,40,9,40,9,40,9
2750 DATA 49,2,51,4,55,4,59,4,63,1,63,1,64,5,69,5,74,2,76,4
2760 DATA 80,3,83,7,90,3,93,6,99,7,106,6
2770 END
32000  END
