KRONOS.BAS


'KRONOS
'All input must be in upper case
'no punctuation except for apostrophes
'adapted from the program "Eliza"
'"Computer Games" (Fontana, 1983)

RANDOMIZE TIMER: NW = 58:
KEY OFF:
SCREEN 12, 0, 0:
PALETTE 1, (65536 * 35 + 256 * 42 + 39)
PALETTE 2, (65536 * 45 + 256 * 52 + 49)

GOSUB ScreenSetup
WIDTH 80: COLOR 1

GOSUB 660 'INITIALIZE

LOCATE 3, 2: PRINT "Welcome to another session with your computer psychiatrist, Kronos."
LOCATE , 2: PRINT "I'm here to help you with your problems. Remember, I am your friend."
LOCATE , 2: PRINT "You can fully confide in me - our conversation will remain strictly"
LOCATE , 2: PRINT "confidential."
PRINT
LOCATE , 2: PRINT "Please type all your input in upper case so I don't have trouble under-"
LOCATE , 2: PRINT "standing you, and be careful about your spelling. I'd also appreciate"
LOCATE , 2: PRINT "it if you didn't use punctuation other than apostrophes."
PRINT
LOCATE , 2: PRINT "I'm sure we can share a fruitful and beneficial relationship."

PRINT : COLOR 1
LOCATE , 2:
PRINT "What is your name, my friend";
COLOR 2
INPUT z$

COLOR 1
FOR DELAY = 1 TO 2000: NEXT: DIM B$(100), A$(100), C$(100)
PRINT
LOCATE , 2: PRINT "Hi "; z$
LOCATE , 2: PRINT "Press spacebar when you're ready to begin . . ."

120 N = N + 1

IF INKEY$ = "" THEN 120
RANDOMIZE TIMER

GOSUB ScreenSetup
COLOR 1
LOCATE 3, 2: PRINT "WHAT IS YOUR PROBLEM ?"

'accept user input

150 GOSUB 590
IF RND 27 THEN GOSUB ScreenSetup: LOCATE 3, 2: COLOR 1
GOSUB 190
GOTO 150

190 'find key word,phrase

z = 0
210 z = z + 1
D = INSTR(A$, B$(z))
IF D 0 THEN 260
IF z < NW THEN 210
GOSUB 440: RETURN

260 'process keywords

LOCATE , po: PRINT C$(z); " ";
IF RIGHT$(C$(z), 1) 0 THEN A$ = RIGHT$(A$, H)
IF z = 30 THEN z$ = A$
z = 0
320 z = z + 1
D = INSTR(A$, F$(z))
IF D 0 THEN 370
IF z 2 THEN L$ = RIGHT$(A$, (z - 2)): L$ = LEFT$(L$, (LEN(L$)) - 1): IF INSTR(K$, L$) = 0 THEN RETURN
IF INSTR(K$, L$) = 0 THEN RETURN
IF z > 2 THEN PRINT RIGHT$(A$, (z - 2))
'IF z < 2 THEN PRINT
'PRINT CHR$(13)
RETURN

440 'random replies - no key word

FU = INT(RND * 13) + 1
ON FU GOSUB 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 583, 586
RETURN

480 LOCATE , 2: PRINT "WHAT DOES THAT SUGGEST TO YOU ?": RETURN
490 LOCATE , 2: PRINT "I SEE ....": RETURN
500 LOCATE , 2: PRINT "YEAH ...": RETURN
510 LOCATE , 2: PRINT "CAN YOU ELABORATE ON THAT ?": RETURN
520 LOCATE , 2: PRINT "THAT IS QUITE INTERESTING.": RETURN
530 LOCATE , 2: PRINT "I'M NOT SURE I UNDERSTAND YOU FULLY.": RETURN
540 LOCATE , 2: PRINT "RIGHT ...": RETURN
550 LOCATE , 2: PRINT "TELL ME MORE": RETURN
560 LOCATE , 2: PRINT "PLEASE GO ON ...": RETURN
570 LOCATE , 2: PRINT "I UNDERSTAND": RETURN
580 LOCATE , 2: PRINT "HOW COME ?": RETURN
583 LOCATE , 2: PRINT "AND WHY IS IT SO ?": RETURN
586 LOCATE , 2: PRINT "THAT ALSO OCCURS IN MY LIFE.": RETURN

'accept user input

590
COLOR 2
LOCATE , 2: INPUT "-", A$: K$ = A$
COLOR 1
IF LEFT$(A$, 3) = "BYE" THEN LOCATE , 2: PRINT "BYE "; z$: PRINT "SEE YOU AGAIN SOME TIME !!": END
K = LEN(A$)
IF LEFT$(A$, 7) = "BECAUSE" THEN A$ = RIGHT$(A$, (K - 7)): K = K - 7
A$ = " " + A$ + " "
RETURN

'initialize

660 N = 0
FOR A = 1 TO NW
READ B$(A), C$(A)
NEXT A
RESTORE 1150
FOR A = 1 TO 8
READ F$(A): READ G$(A)
NEXT A
RETURN

'keywords,replies

DATA "CAN YOU","I CERTAINLY CAN"
DATA "TELL ME","WHAT IF I DON'T WANT TO TELL YOU"
DATA "I DON'T KNOW","I KNOW"
DATA "PLEASE","GOOD TO SEE YOU HAVE MANNERS."
DATA "I LOVE","WELL, EVERYONE LOVES"
DATA "I HATE","I LIKE"
DATA "I NEED","I'LL GIVE YOU"
DATA "DOG","TELL ME MORE ABOUT YOUR PETS."
DATA "GIVE ME","I DON'T WANT TO GIVE YOU"
DATA "YOU SAID","I DID NOT SAY THAT !"
DATA "DO YOU","SOMETIMES I"
DATA "WILL YOU","MAYBE I WON'T"
DATA "SINCE","HOW LONG AGO "
DATA "THEN","MUST I"
DATA "CAN I","NO, YOU CAN'T"
DATA "YOU ARE","HOW DO YOU KNOW I AM"
DATA "YOU'RE","I AM NOT"
DATA "I DON'T","WHY DON'T YOU"
DATA "I FEEL","WHY DO YOU FEEL"
DATA "WHY DON'T YOU","WHY DO YOU WANT ME TO"
DATA "WHY CAN'T I","'CAUSE YOU AREN'T GOOD ENOUGH !!"
DATA "ARE YOU","NO, I'M NOT"
DATA "I CAN'T","HOW DO YOU KNOW YOU CAN'T"
DATA "ARE SO","I AM NOT !! "
DATA "I AM","HOW LONG HAVE YOU BEEN"
DATA "I'M","I KNOW YOU'RE"
DATA "I WANT","WHY DO YOU WANT"
DATA "WHAT","WHAT DO YOU THINK?"
DATA "HOW","I DON'T KNOW !"
DATA "WHO ","ME."
DATA " WHERE","SOMEWHERE !"
DATA "WHY ","THAT IS A DIFFICULT QUESTION."
DATA "WHEN","YESTERDAY."
DATA "MAYBE","WELL, MAYBE NOT !"
DATA "IT IS","WHY IS IT"
DATA "SORRY","SO YOU SHOULD BE."
DATA "I HAVEN'T","WHY HAVEN'T YOU"
DATA "YOURSELF","WHAT ABOUT MYSELF ?"
DATA "HE IS","WHAT IS YOUR REACTION TO HIM BEING"
DATA "I HAVE","HAVE YOU REALLY"
DATA "I LIKE","WHY DO YOU LIKE"
DATA "MY NAME IS","OK FROM NOW ON I'LL CALL YOU"
DATA "NO ","DON'T SAY NO."
DATA "YOUR","WHY ARE YOU CONCERNED ABOUT MY"
DATA "I HATE","WHY DO YOU HATE"
DATA "I THINK","DO YOU DOUBT"
DATA "I'VE","I DON'T BELIEVE YOU REALLY HAVE"
DATA "I'M","YOU'RE NOT"
DATA "YES","GOOD ANSWER."
DATA "SHUT UP","NO NEED TO BE RUDE !"
DATA "MY","WHY DO YOU THINK YOUR"
DATA "AM I","YOU ARE"
DATA "I'D","WHY DON'T YOU"
DATA "I WOULD LIKE TO","WELL, THEN"
DATA "YOU SHOULD","THEN I WILL"
DATA "DIED","YOU HAVE A MORBID PREOCCUPATION WITH DEATH."
DATA "THANK YOU","SO YOU SHOULD THANK ME"

'conjugate

1150 DATA " I ","YOU"
DATA "ARE ","AM"
DATA " MY ","YOUR"
DATA "YOU ","ME"
DATA "YOUR ","MY"
DATA " ME ","YOU"
DATA "AM I ","YOU ARE"
DATA " AM ","ARE"

ScreenSetup:

SCREEN 12: CLS
PALETTE 7, (65536 * 35 + 256 * 30 + 28)
PALETTE 11, (65536 * 60 + 256 * 60 + 60)
PALETTE 12, (65536 * 45 + 256 * 43 + 38)

LOCATE 30: COLOR 12
PRINT "S.Bhattacharya 2/92 Type BYE to quit"
LINE (0, 0)-(639, 460), 7, B
LINE (0, 17)-(640, 17), 11
baba = POINT(1)
LOCATE 1
COLOR 11
PRINT " Computer Psychiatrist"
COLOR 7
PAINT (200, 5), 7, 11
LINE (0, baba)-(640, baba), 7

RETURN

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s