home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / various / psychiatrist.amos / psychiatrist.amosSourceCode
AMOS Source Code  |  1993-01-08  |  3KB  |  64 lines

  1. ' This program will listen to your problems and try to answer back.
  2. ' It works by searching for key words in the sentence and then responding
  3. ' back, depending on what words it found.  
  4. ' Written by Brett George
  5. Screen Open 0,640,256,2,$8000 : Colour 1,4095 : Cls Lowres
  6. PR=26 : Randomize Timer
  7. Dim PROBLEM$(PR)
  8. Global R,PROBLEM$(),ANSW$,PR
  9. For P=0 To PR : Read PROBLEM$(P) : Next 
  10. Data "hate","hostile","fear","aggressive","dislike","love","feel"
  11. Data "angry","impress","like","unwell","sick","paranoid","phobia","scared"
  12. Data "help","kill","murder","torture","helpless","lonely","frightend"
  13. Data "no","you","killed","boring","tired"
  14. Print : Under On : Centre "The Psychiatrist" : Under Off 
  15. Cmove -X Curs,2 : Input "What seems to be the problem? ";ANSW$
  16. Do 
  17.    ANSW$=Lower$(ANSW$) : CHECK_WORDS
  18.    Print : RESPOND : R=0
  19.    Input ANSW$
  20. Loop 
  21. Procedure CHECK_WORDS
  22.    For P=0 To PR
  23.       If Len(ANSW$-PROBLEM$(P))<>Len(ANSW$)
  24.          R=P+1 : Exit 
  25.       End If 
  26.    Next 
  27. End Proc
  28. Procedure RESPOND
  29.    If R=0
  30.       A=Rnd(2)
  31.       If ANSW$-" "=ANSW$
  32.          Print "What seems to be the problem with ";ANSW$+"?"
  33.          Pop Proc
  34.       End If 
  35.       If A=0
  36.          Print "Is that right!"
  37.       End If 
  38.       If A=1
  39.          Print "I'm afraid you'll have to be more specific."
  40.       End If 
  41.       If A=2
  42.          Print "How 'bout describing your problem."
  43.       End If 
  44.    End If 
  45.    If R=1 Then Print "Why do you hate it so bad?"
  46.    If R=2 Then Print "What are you hostile about?"
  47.    If R=3 or R=13 or R=14 or R=15 or R=18 or R=22 Then Print "You have to learn to confront your fears."
  48.    If R=4 Then Print "Why are you so agressive?"
  49.    If R=5 Then Print "Life's to short to worry about little things like that."
  50.    If R=6 Then Print "That's great you feel like that"
  51.    If R=7 Then Print "You shouldn't feel like that."
  52.    If R=8 Then Print "Why don't you calm down."
  53.    If R=9 Then Print "Do you really need to impress him/her so much."
  54.    If R=10 Then Print "That's great you like it so much."
  55.    If R=11 or R=12 Then Print "Maybe you should see a doctor."
  56.    If R=16 Then Print "You have come to the right place for help."
  57.    If R=17 or R=18 or R=19 or R=25 Then Print "There's no reason to be violent."
  58.    If R=20 Then Print "Why don't you try to defend yourself."
  59.    If R=21 Then Print "You should get out more."
  60.    If R=23 Then Print "Don't be so negative."
  61.    If R=24 Then Print "Don't blame me!"
  62.    If R=26 Then Print "Why do you find it so boring?"
  63.    If R=27 Then Print "Try getting some rest!"
  64. End Proc