Jump to content
IGNORED

Looking for ELIZA Program...


Shift838
 Share

Recommended Posts

That was available for many systems, written in BASIC. It should not be that hard to find. Maybe not specifically TI BASIC, but since it only output text is should be easy to port if you can't find a TI version.

 

Yes, I have one I think it's in Atari 800 basic. I just wanted to see if anyone already had a ported version.

Link to comment
Share on other sites

Here's a version that runs under Cortex BASIC. Should be fairly easy to convert to another dialect. The original article/listing is now at www.atariarchives.org/bigcomputergames/showpage.php?page=20.

1 REM LISTING FROM:
2 REM WWW.ATARIARCHIVES.ORG/BIGCOMPUTERGAMES/PAGES/PAGE22.JPG
10 REM
20 REM ELIZA/DOCTOR
30 REM CREATED BY JOSEPH WEIZENBAUM
40 REM THIS VERSION BY JEFF SHRAGER
50 REM EDITED BY BOB ANDERSON
60 REM CREATIVE COMPUTING
61 REM CONVERTED TO CORTEX BASIC BY STUART CONNER 15/06/2012
70 REM
80 REM --- INITIALISATION ---
90 DIM $C[14],$I[14],$K[14],$F[14],$S[14],$R[14],$P[14],$TMP[14],$TMQ[14]
100 DIM SS[36],RR[36],NN[36]
110 N1=36: N2=12: N3=112
120 RESTOR 2530
130 FOR X=1 TO N1
140 READ SS[X],L: RR[X]=SS[X]: NN[X]=SS[X]+L-1
150 NEXT X
155 PRINT @"C": REM CLEAR SCREEN
160 PRINT "HI! I'M ELIZA. WHAT IS YOUR PROBLEM?"
170 REM
180 REM --- USER INPUT ---
190 REM
200 INPUT $I[0]
210 $TMP[0]=" "+$I[0]+" ": $I[0]=$TMP[0]
220 REM
230 FOR L=1 TO LEN[$I[0]]
239 $ZZ=$I[0;L],1
240 IF $ZZ="'" THEN $TMP[0]=$I[0],L-1: $TMQ[0]=$I[0;L+1]: $I[0]=$TMP[0]+$TMQ[0]: GOTO 239
250 IF L+4<=LEN[$I[0]] THEN $ZZ=$I[0;L],4: IF $ZZ="SHUT" THEN PRINT "SHUT UP ...":END
260 NEXT L
270 IF $I[0]=$P[0] THEN PRINT "PLEASE DON'T REPEAT YOURSELF": GOTO 170
280 REM
290 REM --- FIND KEYWORD ---
300 REM
310 RESTOR
320 SSS=0
330 FOR KK=1 TO N1
340 READ $K[0]
350 IF SSS>0 THEN GOTO 390
370 L=POS[$K[0],$I[0]]: IF L>0 THEN SSS=KK: T=L: $F[0]=$K[0]
390 NEXT KK
400 IF SSS>0 THEN KK=SSS: L=T: GOTO 430
410 KK=36: GOTO 630
420 REM
430 REM TAKE RIGHT PART OF STRING
440 REM AND CONJUGATE CORRECTLY
450 REM
460 RESTOR 1230
470 $C[0]=" "+$I[0;LEN[$F[0]]+L]
480 FOR X=1 TO N2/2
490 READ $S[0],$R[0]
500 FOR L=1 TO LEN[$C[0]]
510 IF L+LEN[$S[0]]>LEN[$C[0]] THEN GOTO 560
520 $TMP[0]=$C[0;L],LEN[$S[0]]: IF $TMP[0]<>$S[0] THEN GOTO 560
530 $TMP[0]=$C[0],L-1: $TMQ[0]=$TMP[0]+$R[0]+$C[0;LEN[$S[0]]+L]: $C[0]=$TMQ[0]
540 L=L+LEN[$S[0]]
550 GOTO 600
560 IF L+LEN[$R[0]]>LEN[$C[0]] THEN GOTO 600
570 $TMP[0]=$C[0;L],LEN[$R[0]]: IF $TMP[0]<>$R[0] THEN GOTO 600
580 $TMP[0]=$C[0],L-1: $TMQ[0]=$TMP[0]+$S[0]+$C[0;LEN[$R[0]]+L]: $C[0]=$TMQ[0]
590 L=L+LEN[$S[0]]
600 NEXT L
610 NEXT X
620 REM
630 REM --- GET REPLY ---
640 REM
650 RESTOR 1330
660 FOR X=1 TO RR[KK]: READ $F[0]: NEXT X
670 RR[KK]=RR[KK]+1: IF RR[KK]>NN[KK] THEN RR[KK]=SS[KK]
680 $TMP[0]=$F[0;LEN[$F[0]]]: IF $TMP[0]<>"*" THEN PRINT $F[0]: $P[0]=$F[0]: GOTO 170
690 $TMP[0]=$F[0],LEN[$F[0]]-1: PRINT $TMP[0];$C[0]
700 $P[0]=$F[0]: GOTO 170
1000 REM
1010 REM --- PROGRAM DATA ---
1020 REM
1030 REM --- KEYWORDS ---
1040 REM
1050 DATA "CAN YOU","CAN I","YOU ARE","YOURE","I DONT","I FEEL"
1060 DATA "WHY DONT YOU","WHY CANT I","ARE YOU","I CANT","I AM","IM "
1070 DATA "YOU ","I WANT","WHAT","HOW","WHO","WHERE","WHEN","WHY"
1080 DATA "NAME","CAUSE","SORRY","DREAM","HELLO","HI ","MAYBE"
1090 DATA "NO","YOUR","ALWAYS","THINK","ALIKE","YES","FRIEND"
1100 DATA "COMPUTER","NOKEYFOUND"
1200 REM
1210 REM --- CONJUGATION DATA ---
1220 REM
1230 DATA " ARE "," AM ","WERE ","WAS "," YOU "," I ","YOUR ","MY "
1240 DATA " I'VE "," YOU'VE "," I'M "," YOU'RE "
1300 REM
1310 REM --- REPLIES ---
1320 REM
1330 DATA "DON'T YOU BELIEVE THAT I CAN*"
1340 DATA "PERHAPS YOU WOULD LIKE TO BE ABLE TO*"
1350 DATA "YOU WANT ME TO BE ABLE TO*"
1360 DATA "PERHAPS YOU DON'T WANT TO*"
1370 DATA "DO YOU WANT TO BE ABLE TO*"
1380 DATA "WHAT MAKES YOU THINK I AM*"
1390 DATA "DOES IT PLEASE YOU TO BELIEVE THAT I AM*"
1400 DATA "PERHAPS YOU WOULD LIKE TO BE*"
1410 DATA "DO YOU SOMETIMES WISH YOU WERE*"
1420 DATA "DON'T YOU REALLY*"
1430 DATA "WHY DON'T YOU*"
1440 DATA "DO YOU WISH TO BE ABLE TO*"
1450 DATA "DOES THAT TROUBLE YOU?"
1460 DATA "TELL ME MORE ABOUT SUCH FEELINGS."
1470 DATA "DO YOU OFTEN FEEL*"
1480 DATA "DO YOU ENJOY FEELING*"
1490 DATA "DO YOU REALLY BELIEVE I DON'T*"
1500 DATA "PERHAPS IN GOOD TIME I WILL*"
1510 DATA "DO YOU WANT ME TO*"
1520 DATA "DO YOU THINK YOU SHOULD BE ABLE TO*"
1530 DATA "WHY CAN'T YOU*"
1540 DATA "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM*"
1550 DATA "WOULD YOU PREFER IF I WERE NOT*"
1560 DATA "PERHAPS IN YOUR FANTASIES I AM*"
1570 DATA "HOW DO YOU KNOW I CAN'T*"
1580 DATA "HAVE YOU TRIED?"
1590 DATA "PERHAPS YOU CAN NOW*"
1600 DATA "DID YOU COME TO ME BECAUSE YOU ARE*"
1610 DATA "HOW LONG HAVE YOU BEEN*"
1620 DATA "DO YOU BELIEVE IT IS NORMAL TO BE*"
1630 DATA "DO YOU ENJOY BEING*"
1640 DATA "WE WERE DISCUSSING YOU -- NOT ME."
1650 DATA "OH, I*"
1660 DATA "YOU'RE NOT REALLY TALKING ABOUT ME, ARE YOU?"
1670 DATA "WHAT WOULD IT MEAN IF YOU GOT*"
1680 DATA "WHY DO YOU WANT*"
1690 DATA "SUPPOSE YOU SOON GOT*"
1700 DATA "WHAT IF YOU NEVER GOT*"
1710 DATA "I SOMETIMES ALSO WANT*"
1720 DATA "WHY DO YOU ASK?"
1730 DATA "DOES THAT QUESTION INTEREST YOU?"
1740 DATA "WHAT ANSWER WOULD PLEASE YOU THE MOST?"
1750 DATA "WHAT DO YOU THINK?"
1760 DATA "ARE SUCH QUESTIONS ON YOUR MIND OFTEN?"
1770 DATA "WHAT IT IS YOU REALLY WANT TO KNOW?"
1780 DATA "HAVE YOU ASKED ANYONE ELSE?"
1790 DATA "HAVE YOU ASKED SUCH QUESTIONS BEFORE?"
1800 DATA "WHAT ELSE COMES TO MIND WHEN YOU ASK THAT?"
1810 DATA "NAMES DON'T INTEREST ME."
1820 DATA "I DON'T CARE ABOUT NAMES. GO ON."
1830 DATA "IS THAT THE REAL REASON?"
1840 DATA "DON'T ANY OTHER REASONS COME TO MIND?"
1850 DATA "DOES THAT REASON EXPLAIN ANYTHING ELSE?"
1860 DATA "WHAT OTHER REASON MIGHT THERE BE?"
1870 DATA "PLEASE DON'T APOLOGISE."
1880 DATA "APOLOGIES ARE NOT NECESSARY."
1890 DATA "WHAT FEELINGS DO YOU GET WHEN YOU APOLOGISE?"
1900 DATA "DON'T BE SO DEFENSIVE!"
1910 DATA "WHAT DOES THAT DREAM SUGGEST TO YOU?"
1920 DATA "DO YOU DREAM OFTEN?"
1930 DATA "WHAT PERSONS APPEAR IN YOUR DREAMS?"
1940 DATA "ARE YOU DISTURBED BY YOUR DREAMS?"
1950 DATA "HOW DO YOU DO ... PLEASE STATE YOUR PROBLEM."
1960 DATA "YOU DON'T SEEM QUITE CERTAIN."
1970 DATA "WHY THE UNCERTAIN TONE?"
1980 DATA "CAN'T YOU BE MORE POSITIVE?"
1990 DATA "YOU AREN'T SURE?"
2000 DATA "DON'T YOU KNOW?"
2010 DATA "ARE YOU SAYING THAT JUST TO BE NEGATIVE?"
2020 DATA "YOU ARE BEING A BIT NEGATIVE."
2030 DATA "WHY NOT?"
2040 DATA "ARE YOU SURE?"
2050 DATA "WHY NO?"
2060 DATA "WHY ARE YOU CONCERNED ABOUT MY*"
2070 DATA "WHAT ABOUT YOUR OWN*"
2080 DATA "CAN YOU THINK OF A SPECIFIC EXAMPLE?"
2090 DATA "WHEN?"
2100 DATA "WHAT ARE YOU THINKING OF?"
2110 DATA "REALLY, ALWAYS?"
2120 DATA "DO YOU REALLY THINK SO?"
2130 DATA "BUT YOU ARE NOT SURE YOU*"
2140 DATA "DO YOU DOUBT YOU*"
2150 DATA "IN WHAT WAY?"
2160 DATA "WHAT RESEMBLANCE DO YOU SEE?"
2170 DATA "WHAT DOES THE SIMILARITY SUGGEST TO YOU?"
2180 DATA "WHAT OTHER CONNECTIONS DO YOU SEE?"
2190 DATA "COULD THERE REALLY BE SOME CONNECTION?"
2200 DATA "HOW?"
2210 DATA "YOU SEEM QUITE POSITIVE."
2220 DATA "ARE YOU SURE?"
2230 DATA "I SEE."
2240 DATA "I UNDERSTAND."
2250 DATA "WHY DO YOU BRING UP THE TOPIC OF FRIENDS?"
2260 DATA "DO YOUR FRIENDS WORRY YOU?"
2270 DATA "DO YOUR FRIENDS PICK ON YOU?"
2280 DATA "ARE YOU SURE YOU HAVE ANY FRIENDS?"
2290 DATA "DO YOU IMPOSE ON YOUR FRIENDS?"
2300 DATA "PERHAPS YOUR LOVE FOR FRIENDS WORRIES YOU?"
2310 DATA "DO COMPUTERS WORRY YOU?"
2320 DATA "ARE YOU TALKING ABOUT ME IN PARTICULAR?"
2330 DATA "ARE YOU FRIGHTENED BY MACHINES?"
2340 DATA "WHY DO YOU MENTION COMPUTERS?"
2350 DATA "WHAT DO YOU THINK COMPUTERS HAVE TO DO WITH YOUR PROBLEM?"
2360 DATA "DON'T YOU THINK COMPUTERS CAN HELP PEOPLE?"
2370 DATA "WHAT IS IT ABOUT MACHINES THAT WORRIES YOU?"
2380 DATA "SAY, DO YOU HAVE ANY PSYCHOLOGICAL PROBLEMS?"
2390 DATA "WHAT DOES THAT SUGGEST TO YOU?"
2400 DATA "I SEE."
2410 DATA "I'M NOT SURE I UNDERSTAND YOU FULLY."
2420 DATA "COME, COME, ELUCIDATE YOUR THOUGHTS."
2430 DATA "CAN YOU ELABORATE ON THAT?"
2440 DATA "THAT IS QUITE INTERESTING."
2500 REM
2510 REM --- REPLY FINDING DATA ---
2520 REM
2530 DATA 1,3,4,2,6,4,6,4,10,4,14,3,17,3,20,2,22,3,25,3
2540 DATA 28,4,28,4,32,3,35,5,40,9,40,9,40,9,40,9,40,9,40,9
2550 DATA 49,2,51,4,55,4,59,4,63,1,63,1,64,5,69,5,74,2,76,4
2560 DATA 80,3,83,7,90,3,93,6,99,7,106,6

Edited by Stuart
Link to comment
Share on other sites

 

I tried to download this one off of gameshell but the arc file on this disk must be corrupted or something. I cannot get it extracted.

 

Hmmm... I was able to extract the files with no problems at all using TIDir. Just double click on the image within TIDir and copy the files to a new blank dsk image.

I have attached a disk image with the files expanded and I will replace the orginal image with this one for convenience.

psyarc.dsk

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...