'===========================================================================
' Subject: DOCTOR KOOKOO                      Date: 06-21-96 (16:32)       
'  Author: David Bump                         Code: QB, QBasic, PDS        
'  Origin: FidoNet QUIK_BAS Echo            Packet: AI.ABC
'===========================================================================
'One of my first and favorite, simple little programs, just for fun...
REM Ideas for more things to check: can you, can I, why, why don't you,
REM     why can't I, why can't you, what, how, who, where, when, why, name,
REM     sorry, dream, maybe, no, yes, always, think, alike, friend, computer
REM     never, it is, my, father, mother, sister, brother, pet
REM Ideas for additional features: analyze talkativeness, pos/neg attitude,
REM     repetitiveness, ADD CONJUGATION & PRONOUN CHECKING, posessive ("my")
REM     PUT WORDS TO CHECK IN ARRAY -- USE ONE OR TWO PARSE ROUTINES TO CHECK
REM     small database of words to modify nokey responses, files on users

10 CLS
11 RANDOMIZE TIMER
15 PRINT "Dr. Kookoo -- by David Bump"
16 INPUT "Press ENTER to start"; x$
19 CLS
20 PRINT "The doctor is in.  Type your answers to his questions and then"
21 PRINT "press the 'enter' key."
30 PRINT : PRINT "For best results, limit each response to one simple sentence."
35 PRINT "Don't use commas!  Periods...question marks? and exclamation points! are fine."
37 PRINT "You might represent commas by other symbols like -_+=@#^*."
40 PRINT "Press any key to meet the doctor."
50 DO: LOOP UNTIL INKEY$ <> ""
60 CLS
80 PRINT "Hello, I'm Doctor Kookoo -- the psychiatrist program."
90 PRINT "What is your name?"
95 INPUT n$
100 PRINT : PRINT "That's a fine name.  What is on your mind, "; n$; "?": PRINT
105 PRINT
110 c = c + 1: PRINT : PRINT
120 c1 = c1 + 1
130 IF c1 <= 5 THEN 150
140 c1 = 1
150 INPUT r$
160 PRINT
170 IF MID$(r$, 1, 3) = "bye" OR MID$(r$, 1, 3) = "Bye" THEN 2000
180 IF LEN(r$) < 8 THEN 310
190 IF RIGHT$(r$, 1) = "?" THEN r$ = LEFT$(r$, LEN(r$) - 1): GOTO 640
200 IF RIGHT$(r$, 1) = "!" THEN r$ = LEFT$(r$, LEN(r$) - 1): GOTO 1050
205 IF RIGHT$(r$, 1) = "." THEN r$ = LEFT$(r$, LEN(r$) - 1)
210 IF LEFT$(r$, 7) = "I don't" THEN r$ = RIGHT$(r$, LEN(r$) - 7): GOTO 420
215 IF LEFT$(r$, 8) = "I do not" THEN r$ = RIGHT$(r$, LEN(r$) - 8): GOTO 420
220 IF LEFT$(r$, 4) = "I am" THEN r$ = RIGHT$(r$, LEN(r$) - 4): GOTO 530
225 IF LEFT$(r$, 3) = "I'm" THEN r$ = RIGHT$(r$, LEN(r$) - 3): GOTO 530
230 IF LEFT$(r$, 2) = "I " THEN r$ = RIGHT$(r$, LEN(r$) - 1): GOTO 940
240 FOR x = 1 TO LEN(r$)
REM: more specific responses may be made by taking what's after X+key word(s)
250 IF MID$(r$, x, 7) = "you are" THEN GOTO 830
260 IF MID$(r$, x, 6) = "You're" THEN GOTO 830
270 IF MID$(r$, x, 7) = "Because" OR MID$(r$, x, 7) = "because" THEN 1160
280 NEXT x
300 GOTO 750
310 ON c1 GOTO 320, 340, 360, 380, 400
320 PRINT "Please give me more to go on.": GOTO 110
340 PRINT "Can you tell me more?": GOTO 110
360 PRINT "Please explain further, "; n$; ".": GOTO 110
380 PRINT "Feel free to write longer responses than THAT...": GOTO 110
400 PRINT n$; ", please lengthen your responses!  Try again.": GOTO 110
420 ON c1 GOTO 430, 450, 470, 490, 510
430 PRINT "Why don't you "; r$; "?": GOTO 110
450 PRINT "Would you like to "; r$; "?": GOTO 110
470 PRINT "Why do you suppose you don't "; r$; ".": GOTO 110
490 PRINT "What might be required so you could or would "; r$; "?": GOTO 110
510 PRINT "What do you imagine would happen if you DID "; r$; ", "; n$; "?": GOTO 110
530 ON c1 GOTO 540, 560, 580, 600, 620
540 PRINT "Why are you  "; r$; "?": GOTO 110
560 PRINT "Are you sure you're "; r$; "?": GOTO 110
580 PRINT "Do you enjoy being "; r$; ", "; n$; "?": GOTO 110
600 PRINT "How long do you expect to be "; r$; "?": GOTO 110
620 PRINT n$; ", could you possibly be "; r$; " because you LIKE it?": GOTO 110
640 ON c1 GOTO 650, 670, 690, 710, 730
650 PRINT "What do you think, "; n$; "?": GOTO 110
670 PRINT n$; ", I'm not an answer man.  You must find your own answer to that.": GOTO 110
690 PRINT "Do you ask questions a lot when you're with others?": GOTO 110
710 PRINT "Tell me what you really feel about that, "; n$; ".": GOTO 110
730 PRINT "What's your own 'gut reaction' to this question?": GOTO 110
750 ch = INT(15 * RND) + 1
755 FOR rd = 1 TO ch
757 READ a$
758 NEXT rd
759 RESTORE
760 q = q + 1
770 IF q > 15 THEN 2000
780 PRINT a$
790 GOTO 110
800 DATA Why do you say that?,Has that been on your mind lately?,Go on...,Are yu sure?,Please continue...,I do not understand
810 DATA Could you re-phrase that?,I can hardly believe you said that.,You must be joking.,How can you say that?, I don't think so...
820 DATA No!,Hmmmmm it's a good thing you came to me!,Uh huh... was there anything else?,Perhaps we should close now.,Whew!  I've had enough for today!
830 ON c1 GOTO 840, 860, 880, 900, 920
840 PRINT n$; ", remember that I'm just here to help you.": GOTO 110
860 PRINT "I'm sorry but I can't get personally involved.  ": PRINT : PRINT :
870 PRINT "Tell me how you respond if someone talked about you like that.": GOTO 110
880 PRINT "Hmmmmm... do YOU have a problem with that?": GOTO 110
900 PRINT n$; ", we must get back to YOUR problem... uh, what was it again?": GOTO 110
920 PRINT "Pretend you are talking to yourself and give me your own response.": GOTO 110
940 ON c1 GOTO 950, 970, 990, 1010, 1030
950 PRINT "Do you understand why you "; r$; "?": GOTO 110
970 PRINT "Is it common for you to "; r$; "?": GOTO 110
990 PRINT n$; ", do you like to "; r$; "?": GOTO 110
1010 PRINT "What would you think if *I* were to "; r$; "?": GOTO 110
1030 PRINT "Do you think everyone should "; r$; "?": GOTO 110
1050 ON c1 GOTO 1060, 1080, 1100, 1120, 1140
1060 PRINT "Please don't get overly excited, "; n$; ".": GOTO 110
1080 PRINT "Oh -- is it that important to you?": GOTO 110
1100 PRINT n$; ", don't you feel you are over-reacting?": GOTO 110
1120 PRINT "Tell me why you are so agitated,please.": GOTO 110
1140 PRINT "If you feel that strongly about it, I think we should change the suject.": GOTO 110
1160 ON c1 GOTO 1170, 1190, 1210, 1230, 1250
1170 PRINT "Okay -- but can you name another reason, "; n$; "?": GOTO 110
1190 PRINT "Tell me how you know that is the reason, please.": GOTO 110
1210 PRINT n$; ", what reasons might you hesitate to mention?": GOTO 110
1230 PRINT "Okay,"; n$; ", but now tell me the REAL reason.": GOTO 110
1250 PRINT "Please explain how you arrived at that conclusion.": GOTO 110
2000 PRINT : PRINT : PRINT : PRINT : PRINT
2005 c = ABS(c - q)
2010 PRINT "Okay, that's enough for today.  Here is my diagnosis:"
2020 PRINT : PRINT : PRINT
2030 IF c > 7 THEN 2060
2040 PRINT "You're perfectly normal, "; n$; ", but very boring.": PRINT : PRINT : PRINT
2050 GOTO 2130
2060 IF c > 15 THEN 2090
2070 PRINT "You're a little strange, but you're the kind of person I like best!": PRINT : PRINT : PRINT
2080 GOTO 2130
2090 IF c > 20 THEN 2120
2100 PRINT "Remarkable!  You're even crazier than *I* am!": PRINT : PRINT : PRINT
2110 GOTO 2130
2120 PRINT n$; ", you're either a genius, or you've been peeking at my coding."
2130 PRINT "Goodbye.  For another session, press the F5 key"

