Image Map Image Map
Results 1 to 2 of 2

Thread: ELIZA on RT-11: which?

  1. #1

    Default ELIZA on RT-11: which?

    Hi,

    I'm preparing a RT-11 distro for a "living" museum PDP-11/34 and like to have ELIZA there.

    I ported an ALTAIR version to BASIC-11 (see below), which labels itself as "inferior imitation".

    The DECUS-TECO implementation also claims to be "less powerful" than the Weizenbaum LISP version.

    Has anyone a pointer to the Weizenbaum source and a compatible LISP on RT-11 (v5.5)?
    Or other implementations?

    Thanks,
    Joerg

    10 REM
    20 REM ELIZA/DOCTOR
    30 REM CREATED BY JOSEPH WEIZENBAUM
    40 REM THIS VERSION BY JEFF SHRAGER
    50 REM EDITED AND MODIFIED FOR MITS 8K BASIC 4.0 BY STEVE NORTH
    60 REM CREATIVE COMPUTING PO BOX 789-M MORRISTOWN NJ 07960
    70 REM https://vintagecomputer.net/cisc367/...%20listing.pdf
    75 REM PORTED TO BASIC-11 JOERG HOPPE JAN 2020. j_hoppe@t-online.de
    80 REM
    90 DIM C$(72),I$(72),K$(72),F$(72),S$(72),R$(72),P$(72),Z $(72)
    100 DIM S(36),R(36),N(36)
    110 N1=36 \ N2=12 \ N3=112
    120 FOR X=1 TO N1+N2+N3 \READ Z$ \ NEXT X \ REM SKIP TO 2530 DATA
    130 FOR X=1 TO N1
    140 READ S(X),L \ R(X)=S(X) \ N(X)=S(X)+L-1
    150 NEXT X
    160 PRINT "HI! I'M ELIZA. WHAT'S YOUR PROBLEM?"
    170 REM
    180 REM -----USER INPUT SECTION-----
    190 REM
    200 LINPUT I$
    201 I$=" "+I$+" "
    210 REM GET RID OF APOSTROPHES
    220 X$=I$ \ I$="" \ FOR L=1 TO LEN(X$)
    230 IF SEG$(X$,L,L) <> "'" THEN I$=I$+SEG$(X$,L,L)
    235 REM THE WORD "SHUT" TERMINATES
    240 IF SEG$(I$,LEN(I$)-3,LEN(I$)) = "SHUT" THEN PRINT "SHUT UP.." \STOP
    250 NEXT L
    255 IF I$=P$ THEN PRINT "PLEASE DON'T REPEAT YOURSELF!" \ GOTO 170
    260 REM
    270 REM -----FIND KEYWORD IN I$-----
    280 REM
    290 RESTORE
    295 S=0
    300 FOR K=1 TO N1
    310 READ K$
    315 IF S>0 THEN 360 \ REM ALWAYS READ ALL KEYWORDS
    320 T=POS(I$,K$,1)
    321 rem print i$,K$,t
    330 IF T > 0 THEN F$=K$ \ S = K \ REM KEYWORD F$, IDX S FOUND AT POS T
    360 NEXT K
    365 IF S>0 THEN K=S \ L=T \ GOTO 390 \ REM FOUND: KEYWORD F$, IDX K FOUND AT POS L
    370 K=36 \ GOTO 570 \ REM WE DIDN'T FIND ANY KEYWORDS
    380 REM
    390 REM TAKE RIGHT PART OF STRING AND CONJUGATE IT
    400 REM USING THE LIST OF STRINGS TO BE SWAPPED
    410 REM EXAMPLE: "IM HUNGRY" => "YOURE HUNGRY"
    411 rem print "KEYWD is "; F$, " len="; len(f$)," L=";L
    420 RESTORE \ FOR X=1 TO N1 \ READ Z$ \ NEXT X \ REM SKIP OVER KEYWORDS
    430 C$=" " + SEG$(I$,L+LEN(F$),LEN(I$)) \ REM USER INPUT RIGHT OF KEYWD
    431 rem print "user phrase: ", C$
    440 FOR X=1 TO N2/2
    450 READ S$,R$ \ REM IN C$ REPLACE EVERY S$ BY A R$
    460 FOR L=1 TO LEN(C$)
    470 IF L+LEN(S$) > LEN(C$) THEN 510 \ REM SEARCH FOR S$, INSERT R$
    480 T=POS(C$,S$,L) \ IF T=0 THEN GOTO 510
    490 C$=SEG$(C$,1,T-1) + R$ + SEG$(C$, T+LEN(S$), LEN(C$))
    495 L=T+LEN(R$)
    500 GOTO 540
    510 IF L+LEN(R$) > LEN(C$) THEN 540 \ REM SEARCH FOR R$, INSERT S$
    520 T=POS(C$,R$,L) \ IF T=0 THEN GOTO 540
    525 rem print "xxx",SEG$(C$,1,T-1),S$,SEG$(C$, T+LEN(R$), LEN(C$))
    530 C$=SEG$(C$,1,T-1) + S$ + SEG$(C$, T+LEN(R$), LEN(C$))
    535 rem print "=> ",c$
    535 L=T+LEN(S$)
    540 NEXT L
    550 NEXT X
    551 rem print "conjugated user phrase: ", C$
    555 IF SEG$(C$,1,1)=" " THEN C$=SEG$(C$,2,LEN(C$)-1) \ REM ONLY 1 SPACE
    560 REM
    570 REM NOW USING THE KEYWORD NUMBER (K) GET REPLY
    580 REM
    590 RESTORE \ FOR X=1 TO N1+N2 \ READ Z$ \ NEXT X
    600 FOR X=1 TO R(K) \ READ F$ \ NEXT X \ REM READ RIGHT REPLY
    610 R(K)=R(K)+1 \ IF R(K)>N(K) THEN R(K)=S(K)
    620 IF SEG$(F$,LEN(F$),LEN(F$)) <> "*" THEN PRINT F$ \ P$=I$ \ GOTO 170
    630 PRINT SEG$(F$,1, LEN(F$)-1); C$
    640 P$=I$ \ GOTO 170
    1000 REM
    1010 REM -----PROGRAM DATA FOLLOWS-----
    1020 REM
    1030 REM KEYWORDS (COUNT=N1)
    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","FRIEN D"
    1100 DATA "COMPUTER","NOKEYFOUND"
    1200 REM
    1210 REM STRING DATA FOR CONJUGATION KEYWORDS (COUNT=N2)
    1220 REM
    1230 DATA " ARE "," AM ", "WERE ","WAS "," YOU "," I ","YOUR ","MY "
    1235 DATA " IVE ", " YOUVE"," IM ", " YOURE "
    1300 REM
    1310 REM REPLIES (COUNT=N3)
    1320 REM
    1330 DATA "DON'T YOU BELIVE 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*"
    1365 DATA "DO YOU WANT TO BE ABLE TO*"
    1370 DATA "WHAT MAKES YOU THINK I AM*"
    1380 DATA "DOES IT PLEASE YOU TO BELIVE I AM*"
    1390 DATA "PERHAPS YOU WOULD LIKE TO BE*"
    1400 DATA "DO YOU SOMETIMES WISH YOU WERE*"
    1410 DATA "DON'T YOU REALLY*"
    1420 DATA "WHY DON'T YOU*"
    1430 DATA "DO YOU WISH TO BE ABLE TO*"
    1440 DATA "DOES THATT TROUBLE YOU?"
    1450 DATA "TELL ME MORE ABOUT SUCH FEELINGS."
    1460 DATA "DO YOU OFTEN FEEL*"
    1470 DATA "DO YOU ENJOY FEELING*"
    1480 DATA "DO YOU REALLY BELIEVE I DON'T*"
    1490 DATA "PERHAPS IN GOOD TIMES I WILL*"
    1500 DATA "DO YOU WANT ME TO*"
    1510 DATA "DO YOU THINK YOU SHOULD BE ABLETO*"
    1520 DATA "WHY CAN'T YOU*"
    1530 DATA "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM*"
    1540 DATA "WOULD YOU PREFER IF I WERE NOT*"
    1550 DATA "PERHAPS IN YOUR FANTASIES I AM*"
    1560 DATA "HOW DO YOU KNOW YOU CAN'T*"
    1570 DATA "HAVE YOU TRIED?"
    1580 DATA "PERHAPS YOU CAN NOW*"
    1590 DATA "DID YOU COME TO ME BECAUSE YOU ARE*"
    1600 DATA "HOW LONG HAVE YOU BEEN*"
    1610 DATA "DO YOU BELIEVE IT IS NORMAL TO BE*"
    1620 DATA "DO YOU ENJOY BEEING*"
    1630 DATA "WE WERE DISCUSSING YOU-- NOT ME."
    1640 DATA "OH, I*"
    1650 DATA "YOU'RE NOT REALLY TALKING ABOUT ME, ARE YOU?"
    1660 DATA "WHAT WOULD IT MEAN TO YOU IF YOU GOT*"
    1670 DATA "WHY DO YOU WANT*"
    1680 DATA "SUPOOSE YOU SOON GOT*"
    1690 DATA "WHAT IF YOU NEVER GOT*"
    1700 DATA "I SOMETIMES ALSO WANT*"
    1710 DATA "WHY DO YOU ASK?"
    1720 DATA "DOES THAT QUESTION INTEREST YOU?"
    1730 DATA "WHAT ANSWER WOULD PLEASE YOU MOST?"
    1740 DATA "WHAT DO YOU THINK?"
    1750 DATA "ARE SUCH QUESTIONS ON YOUR MIND OFTEN?"
    1760 DATA "WHAT IS IT THAT YOU REALLY WANT TO KNOW?"
    1770 DATA "HAVE YOU ASKED ANYONE ELSE?"
    1780 DATA "HAVE YOU ASKED SUCH QUESTIONS BEFORE?"
    1790 DATA "WAHT ELSE COMES TO MIND WHEN YOU ASK THAT?"
    1800 DATA "NAMES DON'T INTEREST ME."
    1810 DATA "I DON'T CARE ABOUT NAMES-- PLEASE GO ON."
    1820 DATA "IS THAT THE REAL REASON?"
    1830 DATA "DAN'T ANY OTHER REASONS COME TO MIND?"
    1840 DATA "DOES THAT REASON EXPLAIN ANYTHING ELSE?"
    1850 DATA "WHAT OTHER REASONS MIGHT THERE BE?"
    1860 DATA "PLEASE DON'T APOLOGIZE."
    1870 DATA "APOLOGIES ARE NOT NECESSARY."
    1880 DATA "WHAT FEELINGS DO YOU HAVE WHEN YOU APOLOGIZE."
    1890 DATA "DON'T BE SO DEFENSIVE!"
    1900 DATA "WHAT DOES THAT DREAM SUGGEST TO YOU?"
    1910 DATA "DO YOU DREAM OFTEN?"
    1920 DATA "WHAT PERSONS APPEAR IN YOUR DREAMS?"
    1930 DATA "ARE YOU DISTRUBED BY YOUR DREAMS?"
    1940 DATA "HOW DO YOU DO ... PLEASE STATE YOUR PROBLEM."
    1950 DATA "YOU DON'T SEEM QUITE CERTAIN."
    1960 DATA "WHY THE UNCERTAIN TONE?"
    1970 DATA "CAN'T YOU BE MORE POSITIVE?"
    1980 DATA "YOU AREN'T SURE?"
    1990 DATA "DON'T YOU KNOW?"
    2000 DATA "ARE YOU SAYING NO JUST TO BE NEGATIVE?"
    2010 DATA "YOU ARE BEEING A BIT NEGATIVE."
    2020 DATA "WHY NOT?"
    2030 DATA "ARE YOU SURE?"
    2040 DATA "WHY NO?"
    2050 DATA "WHY ARE YOU CONCERNED ABOUT MY*"
    2060 DATA "WHAT ABOUT YOUR OWN*"
    2070 DATA "CAN YOU THINK OF A SPECIFIC EXAPLE?"
    2080 DATA "WHEN?"
    2090 DATA "WHAT ARE YOU THINKING OF?"
    2100 DATA "REALLY, ALWAYS?"
    2110 DATA "DO YOU REALLY THINK SO?"
    2120 DATA "BUT YOU ARE NOT SURE YOU*"
    2130 DATA "DO YOU DOUBT YOU*"
    2140 DATA "IN WHAT WAY?"
    2150 DATA "WHAT RESEMBLANCES DO YOU SEE?"
    2160 DATA "WHAT DOES THE SIMILARITY SUGGEST TO YOU?"
    2170 DATA "WHAT OTHER CONNECTIONS DO YOU SEE?"
    2180 DATA "COULD THERE REALLY BE SOME CONNECTION?"
    2190 DATA "HOW?"
    2200 DATA "YOU SEEM QUITE POSITIVE."
    2210 DATA "ARE YOU SURE?"
    2220 DATA "I SEE."
    2230 DATA "I UNDERSTAND."
    2240 DATA "WHY DO YOU BRING UP THE TOPIC OF FRIENDS?"
    2250 DATA "DO YOUR FRIENDS WORRY YOU?"
    2260 DATA "DO YOUR FRIENDS PICK ON YOU?"
    2270 DATA "ARE YOU SURE YOU HAVE AY FRIENDS?"
    2280 DATA "DO YOU IMPOSE ON YOUR FRIENDS?"
    2290 DATA "PERHAPS YOUR LOVE FOR FRIENDS WORRIES YOU."
    2300 DATA "DO COMPUTERS WORRY YOU?"
    2310 DATA "ARE YOU TALKING ABOUT ME IN PARTICULAR?"
    2320 DATA "ARE YOU FRIGHTEND BY MACHINES?"
    2330 DATA "WHY DO YOU MENTION COMPUTERS?"
    2340 DATA "WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEM?"
    2350 DATA "DON'T YOU THINK COMPUTERS CAN HELP PEOPLE?"
    2360 DATA "WHAT IS IT ABOUT MACHINES THAT WORRIES YOU?"
    2370 DATA "SAY, DO YOU HAVE ANY PSYCHOLOGICAL PROBLEMS?"
    2380 DATA "WHAT DOES THAT SUGGEST TO YOU?"
    2390 DATA "I SEE."
    2400 DATA "I'M NOT SURE I UNDERSTAND YOU FULLY."
    2410 DATA "COME COME ELUCIDATE YOUR THOUGHTS."
    2420 DATA "CAN YOU ELABORATE ON THAT?"
    2430 DATA "THAT IS QUITE INTERESTING."
    2500 REM
    2510 REM DATA FOR FINDING RIGHT REPLIES
    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,64,5,69,5,69,5,74,2,76,4
    2560 DATA 80,3,83,7,90,3,93,6,99,7,106,6


  2. #2
    Join Date
    May 2009
    Location
    Connecticut
    Posts
    4,571
    Blog Entries
    1

    Default

    The Cosell implementation of Eliza in Lisp is linked at http://elizagen.org/ That is the first Lisp Eliza as the site explains.

    http://www.softwarepreservation.org/ has two Lisp versions for PDP-11 http://www.softwarepreservation.org/...ts/LISP/vlisp/ seems to be for RT-11. I haven't tested either to see if it works with the Lisp Eliza. I never used Lisp back when I was active with a PDP-11.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •